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.
Created attachment 115618 [details] screenshot + project source
See MavenAnnotationProcessingQueryImplTest; there is no distinction made yet between test and main annotation sources. Also there is a bug in maven-compiler-plugin, it seems. It should be creating target/generated-test-sources/annotations yet it is creating target/generated-sources/test-annotations instead. This means that TestTargetImpl.java is put in the same sourcepath as Target.java, which is of course wrong and probably responsible for the error in the Java editor. Needs to filed and fixed upstream; as a workaround, NbMavenProjectImpl.getGeneratedSourceRoots could hardcode support for this particular dir name.
Reporter adds a workaround: add to maven-compiler-plugin configuration <generatedTestSourcesDirectory>${project.build.directory}/generated-test-sources/annotations</generatedTestSourcesDirectory> which is what the testCompile mojo's default ought to be.
Reporter writes (please use BZ's Comments field in the future): ---- when use only generatedTestSourcesDirectory that produce error on generated files by annotation (non test) on this need use generatedTestSourcesDirectory and generatedSourcesDirectory <goal> to-use is not necessary ---- but should check again - I tried adding just <generatedTestSourcesDirectory>${project.build.directory}/generated-test-sources/annotations</generatedTestSourcesDirectory> to the sample project/pom.xml, and doing a clean build, and all files looked fine including TargetImpl.java. By the way it should also work to refer to generated sources from static sources, e.g.: public abstract class Target { static final Target t = new TargetImpl(); } or abstract class TestTarget { static final TestTarget t = new TestTargetImpl(); } even on a clean project.
Filed https://jira.codehaus.org/browse/MCOMPILER-167 for plugin issue.
core-main #e928fc875ffd
Integrated into 'main-golden', will be available in build *201204040400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/0fbbbec19dbe User: Jesse Glick <jglick@netbeans.org> Log: (mentioned in #208286) MCOMPILER-167 workaround: treat target/generated-sources/test-*/ as a mistaken synonym for target/generated-test-sources/*/.
(In reply to comment #4) > Filed https://jira.codehaus.org/browse/MCOMPILER-167 for plugin issue. Fixed in 2.4.