This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 219453 - dependencies with <type>test-jar</type> is not fully registered by the editor
Summary: dependencies with <type>test-jar</type> is not fully registered by the editor
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.3
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
: 221125 221320 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-03 13:48 UTC by akobberup
Modified: 2012-11-14 18:45 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description akobberup 2012-10-03 13:48:39 UTC
I have a few projects that are setup and build with maven.

One of these (my serverframework) contains a test framework and some test packages that are used by the other projects. 
The test stuff is located in the src\test\java.. folder and is not included in the normal serverframework.jar, but in the serverframework-test.jar.

My other project has a normal dependency to the serverframework, as well as a dependency to the serverframework-test.jar as the testframework herein is used in this project as well.

<dependency>
  <groupId>xx</groupId>
  <artifactId>serverframework</artifactId>
  <version>${project.version}</version>
</dependency>
<dependency>
  <groupId>xx</groupId>
  <artifactId>serverframework</artifactId>
  <version>${project.version}</version>
  <type>test-jar</type>
  <scope>test</scope>
</dependency>

This work just fine when compiling and running tests on the projects that has dependencies to the serverframework.

The problem is that in the java editor all references in the refering project to the classes in the testframework in the serverframework is marked as errors.
This can be explained by the editor using the maven artifact from the first dependency. However, as this is a class in the test packages, i would suppose that the editor used the <scope>test</scope> artiface, which is containing the classes refered.

I think this issue has been introduced within the last couple of weeks (i see it now in 201210020001, and have also seen it in 201209260001 and 201209220001.
Before that i did not get these errors.
Comment 1 Milos Kleint 2012-10-05 08:54:33 UTC
http://hg.netbeans.org/core-main/rev/250830750095

after a rewrite we handled all GAV artifacts in local repo equally. Now only the main artifact is considered for main sources mapping and the "tests" classifier artifact for test source roots. Other classifiers are ignored and served from local repository only
Comment 2 Quality Engineering 2012-10-07 02:01:50 UTC
Integrated into 'main-golden', will be available in build *201210070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/250830750095
User: Milos Kleint <mkleint@netbeans.org>
Log: #219453 dependency's "tests" classifier needs proper handling (redirect to test rather than main sources of the project in question. Other artifacts with classifier are to be left unconnected and only content from local repository is used.
Comment 3 Milos Kleint 2012-11-02 13:50:22 UTC
*** Bug 221320 has been marked as a duplicate of this bug. ***
Comment 4 Milos Kleint 2012-11-14 18:45:48 UTC
*** Bug 221125 has been marked as a duplicate of this bug. ***