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 267843 - Maven Project Cannot Resolve Dependency To Another Maven Project Which Used XMLBeans To Generate Sources From XSD
Summary: Maven Project Cannot Resolve Dependency To Another Maven Project Which Used X...
Status: NEW
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-03 07:35 UTC by myatt83
Modified: 2016-09-03 07:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NetBeans Mavens Projects A and B (7.55 KB, application/zip)
2016-09-03 07:35 UTC, myatt83
Details

Note You need to log in before you can comment on or make changes to this bug.
Description myatt83 2016-09-03 07:35:19 UTC
Created attachment 161885 [details]
NetBeans Mavens Projects A and B

In NB 8.0 and 8.1, I have the following issue:

I created a Maven based project (ProjectA) that has a valid XSD file in it. The POM defines an xmlbeans plugin and I can build the maven project, the java sources get generated and the project builds just fine into a JAR.

I created another Maven based project (ProjectB) that has a single empty java source file (NewCLass.java). I manually add an import statement on the top of the file to reference a class generated by the xmlbeans plugin in ProjectA. I right-click the dependencies node for ProjectB and search for and find ProjectA's JAR in the local repo. Then ProjectA gets listed under ProjectB's Dependencies as expected. However, the java file in ProjectB cannot ever resolve the imported package from ProjectA. 

Just to make sure I'm not nuts, I go back to projectA and manually created a new Java source file (Bar.java). I clean and build ProjectA. Foo.java gets compiled, the XSD generates its code, and the ProjectA JAR gets generated.

In ProjectB in NewClass.java I add an import statement for the Foo class from projectA and IT CAN correctly resolve it.

It seems that ProjectB CAN resolve "regular" java classes/packages from ProjectA, but CANNOT resolve "xmlbeans-generated" java classes/packages from ProjectA.

I constantly have tried clean and build, reindexing local maven repo, etc., but no luck.

I will attach both small projects in their entirety so you can reproduce the issue.

I have seen this exact same issue in NetBeans 8, 8.1, and latest daily build from 02-Sep-2016.