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 190852 - Maven sourcepath missing newly created gensrc roots
Summary: Maven sourcepath missing newly created gensrc roots
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 191518 (view as bug list)
Depends on:
Blocks: 188323 204545
  Show dependency tree
 
Reported: 2010-10-08 13:47 UTC by Jan Lahoda
Modified: 2012-05-10 19:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch that was built in the IDE while doing these tests - should not affect the result from the ClassPath, to my knowledge. (3.76 KB, patch)
2010-10-08 13:47 UTC, Jan Lahoda
Details | Diff
Screenshot from IDE when the compile CP appears to be broken. (284.42 KB, image/png)
2010-10-08 13:47 UTC, Jan Lahoda
Details
"Bad" CP listings (5.93 KB, text/plain)
2010-10-08 13:48 UTC, Jan Lahoda
Details
"Good" CP. (9.83 KB, text/plain)
2010-10-08 13:48 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2010-10-08 13:47:08 UTC
Created attachment 102318 [details]
Patch that was built in the IDE while doing these tests - should not affect the result from the ClassPath, to my knowledge.

[custom build from 25743d95d6de, with a custom patch for SourceForBinaryQuery, will be attached]

While trying to reproduce bug #188323: I have a checkout of:
http://svn.apache.org/repos/asf/maven/maven-3/trunk
revision 960018. It has been built before, so various generated sources exist.

When I did:
1. rm ~/.m2
2. start with clean userdir
3. open the "trunk", wait until the project is recognized, scanned.
4. open required projects
5. build "trunk"
6. On each project, from top, resolve problems

As a result, there are compilation errors in Maven Compat, DefaultRepositoryMetadataManager, claiming that org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader cannot be found. Looking at the compile classpath of the DRMM, it really does not refer to maven-repository-metadata-3.0-SNAPSHOT.jar (and so the compilation errors are correct from the parser's point of view). The CP does not change after restart and deleting ${userdir}/var/cache. I am attaching a screenshot and list of all classpath (maven-188323-bad-cp.png and maven-188323-bad-cp.txt respectivelly), as returned after second IDE restart.

When I did not do step "5" (starting again with a clean userdir and deleting .m2), there are no compilation errors for any of the projects and the compilation classpath is different (maven-188323-good-cp.txt).

(Note that the results may be non-deterministic - I was performing similar steps many times, and the results were not always consistent or predictable.)
Comment 1 Jan Lahoda 2010-10-08 13:47:56 UTC
Created attachment 102319 [details]
Screenshot from IDE when the compile CP appears to be broken.
Comment 2 Jan Lahoda 2010-10-08 13:48:21 UTC
Created attachment 102320 [details]
"Bad" CP listings
Comment 3 Jan Lahoda 2010-10-08 13:48:54 UTC
Created attachment 102321 [details]
"Good" CP.
Comment 4 Jan Lahoda 2011-02-25 21:05:21 UTC
Using a recent (from yesterday) build, I see another problem with source path: after building the maven project, the source path for e.g. maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java is:
/space/maven/trunk/maven-compat/src/main/java
/space/maven/trunk/maven-compat/src/main/scala
/space/maven/trunk/maven-compat/src/main/groovy
/space/maven/trunk/maven-compat/src/main/resources

which is wrong, it should also contain:
maven-model/target/generated-sources/modello
The classpath for this folder is (seems to be) the same as above and does not contain the folder itself, causing further problems. After restart, the sourcepath is correct.

This is on:
Path: .
URL: http://svn.apache.org/repos/asf/maven/maven-3/trunk
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 1074467
Node Kind: directory
Schedule: normal
Last Changed Author: bentmann
Last Changed Rev: 1074306
Last Changed Date: 2011-02-24 22:31:36 +0100 (Thu, 24 Feb 2011)
Comment 5 Jesse Glick 2011-03-11 15:34:48 UTC
Did I get the summary right?
Comment 6 Jesse Glick 2012-03-14 15:00:00 UTC
Observed with https://github.com/hudson/hudson.git projects: open root and prime; open hudson-core and prime, which is successful. "Generated Sources (localized)" appears in logical view yet various source files are marked as erroneous due to missing Messages, even though Messages.java in fact exist. Metadata inspector confirms that sourcepath for src/main/java/ is missing target/generated-sources/*/ entries. Fixed by IDE restart.
Comment 7 Milos Kleint 2012-03-15 12:34:38 UTC
(In reply to comment #6)
> Observed with https://github.com/hudson/hudson.git projects: open root and
> prime; open hudson-core and prime, which is successful. "Generated Sources
> (localized)" appears in logical view yet various source files are marked as
> erroneous due to missing Messages, even though Messages.java in fact exist.
> Metadata inspector confirms that sourcepath for src/main/java/ is missing
> target/generated-sources/*/ entries. Fixed by IDE restart.

trying almost the same but building instead of priming, results in correct behaviour for me. I've tried the jenkins repo instead of hudson (had that one checked out already). clean vs build actions seemed to add/remove the error markers correctly, however it took a hell of time get fully updated, the project is rather big.
Comment 8 Milos Kleint 2012-03-15 13:23:55 UTC
same with maven-model, clean vs. build adds/removes error marks in files correctly (after a while)
Comment 9 Jesse Glick 2012-04-10 20:07:58 UTC
core-main #2b662d595857
Comment 10 Quality Engineering 2012-04-11 09:57:50 UTC
Integrated into 'main-golden', will be available in build *201204110400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2b662d595857
User: Jesse Glick <jglick@netbeans.org>
Log: #190852: Maven sourcepath missing newly created gensrc roots
Comment 11 Quality Engineering 2012-04-12 10:02:00 UTC
Integrated into 'main-golden', will be available in build *201204120400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2b662d595857
User: Jesse Glick <jglick@netbeans.org>
Log: #190852: Maven sourcepath missing newly created gensrc roots
Comment 12 Milos Kleint 2012-04-23 11:40:34 UTC
*** Bug 191518 has been marked as a duplicate of this bug. ***