#11 Modular builds fail with non-modular dependencies
Closed 2 years ago by mbooth. Opened 2 years ago by mbooth.

I'm trying to update a package where the upstream project became a fully modular JPMS project. This project has deps that are not yet modular.

When built in mock, I see this:

[WARNING] Can't extract module name from ant.jar: null
[WARNING] Can't extract module name from classes: null
[WARNING] Can't extract module name from ant-launcher.jar: null
[INFO] Changes detected - recompiling the module!
[DEBUG] Classpath:
[DEBUG] Modulepath:
[DEBUG]  /builddir/build/BUILD/jaxb-ri-2.3.3-RI/jaxb-ri/external/rngom/target/rngom-2.3.3.jar
[DEBUG]  /builddir/build/BUILD/jaxb-ri-2.3.3-RI/jaxb-ri/external/relaxng-datatype/target/relaxng-datatype-2.3.3.jar
[DEBUG]  /builddir/build/BUILD/jaxb-ri-2.3.3-RI/jaxb-ri/txw/runtime/target/txw2-2.3.3.jar
[DEBUG]  /builddir/build/BUILD/jaxb-ri-2.3.3-RI/jaxb-ri/codemodel/codemodel/target/codemodel-2.3.3.jar
[DEBUG]  /builddir/build/BUILD/jaxb-ri-2.3.3-RI/jaxb-ri/xsom/target/xsom-2.3.3.jar
[DEBUG] Source roots:
[DEBUG]  /builddir/build/BUILD/jaxb-ri-2.3.3-RI/jaxb-ri/txw/compiler/src/main/java
[DEBUG]  /builddir/build/BUILD/jaxb-ri-2.3.3-RI/jaxb-ri/txw/compiler/target/generated-sources/annotations

And then the build fails due to missing symbols that should be supplied by the non-modular ant dependencies.

When building the upstream project I see this:

[INFO] Changes detected - recompiling the module!
[DEBUG] Classpath:
[DEBUG]  /home/mbooth/git/jaxb-ri/jaxb-ri/txw/compiler/target/classes
[DEBUG]  /home/mbooth/.m2/repository/org/apache/ant/ant/1.10.7/ant-1.10.7.jar
[DEBUG]  /home/mbooth/.m2/repository/org/apache/ant/ant-launcher/1.10.7/ant-launcher-1.10.7.jar
[DEBUG] Modulepath:
[DEBUG]  /home/mbooth/.m2/repository/com/sun/xml/bind/external/rngom/2.3.3/rngom-2.3.3.jar
[DEBUG]  /home/mbooth/.m2/repository/com/sun/xml/bind/external/relaxng-datatype/2.3.3/relaxng-datatype-2.3.3.jar
[DEBUG]  /home/mbooth/.m2/repository/org/glassfish/jaxb/txw2/2.3.3/txw2-2.3.3.jar
[DEBUG]  /home/mbooth/.m2/repository/org/glassfish/jaxb/codemodel/2.3.3/codemodel-2.3.3.jar
[DEBUG]  /home/mbooth/.m2/repository/org/glassfish/jaxb/xsom/2.3.3/xsom-2.3.3.jar
[DEBUG] Source roots:
[DEBUG]  /home/mbooth/git/jaxb-ri/jaxb-ri/txw/compiler/src/main/java
[DEBUG]  /home/mbooth/git/jaxb-ri/jaxb-ri/txw/compiler/target/generated-sources/annotations

And the build succeeds.

You can see that in mock there is some difference that is causing non-modular deps to be omitted from the build classpath. But as you can see from the upstream build, there should be no problem for a modular project to have non-modular deps.


I think we can enable the minimal build for this package again, would that help as a "workaround" in this case?

But in general, is this maybe an issue in xmvn @mizdebsk ?

I did some debugging when I found everything worked fine when I downgraded to the F31 versions of maven-compiler-plugin and plexus-languages.

It's because there was a problem with the plexus-languages package. A vital class was missing for detecting/generating JPMS module names when a build was both running on JDK 11 and targeting JDK 9+.

When I tried to rebuild the plexus-languages package I found it also suffered from the above problem, so I had to kind of "rebootstrap" the package in this commit:

https://src.fedoraproject.org/rpms/plexus-languages/c/d673c8c853fb2dc087304cdb5d575deb4a0d7739

And then rebuild it as a proper conforming JPMS module in this commit:

https://src.fedoraproject.org/rpms/plexus-languages/c/eeb6f8ab815b82545561e5f2fef537d3dc397a59

And now I think the problem is solved.

Metadata Update from @mbooth:
- Issue status updated to: Closed (was: Open)

2 years ago

Login to comment on this ticket.

Metadata