Closed
Description
When scanning existing files, org.codehaus.plexus.languages.java.jpms.LocationManager.resolvePaths
will take a scanning request containing a possible JavaHome location.
But the BinaryModuleInfoParser does not use this javaHome location,, resulting in:
Caused by: java.lang.module.InvalidModuleDescriptorException: Unsupported major.minor version 59.0
at jdk.internal.module.ModuleInfo.invalidModuleDescriptor (ModuleInfo.java:1091)
at jdk.internal.module.ModuleInfo.doRead (ModuleInfo.java:195)
at jdk.internal.module.ModuleInfo.read (ModuleInfo.java:131)
at java.lang.module.ModuleDescriptor.read (ModuleDescriptor.java:2487)
at org.codehaus.plexus.languages.java.jpms.BinaryModuleInfoParser.parse (BinaryModuleInfoParser.java:35)
at org.codehaus.plexus.languages.java.jpms.AbstractBinaryModuleInfoParser.getModuleDescriptor (AbstractBinaryModuleInfoParser.java:45)
at org.codehaus.plexus.languages.java.jpms.LocationManager.resolvePaths (LocationManager.java:127)
at org.apache.maven.plugin.compiler.CompilerMojo.preparePaths (CompilerMojo.java:238)
Downstream issue and how to reproduce in a single, repeated step (try mvn compile
twice):
https://issues.apache.org/jira/browse/MCOMPILER-455
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
torakiki commentedon Feb 15, 2021
I checked out the latest snapshot 3.9.0 of the compiler plugin, installed locally and used that in my real life repo together with plexus-java 1.0.6 and I got a warning and a compilation error:
So I managed to set up a test multi module repo with a parent and 2 children where child2 depends on child1 https://github.com/torakiki/test and I get the same result, using maven compiler 3.9.0-SNAPSHOT and plexus-java 1.0.6:
From what I can see from the logs child1 module is actually missing from the module path.
#64 BinaryModuleInfoParser.parse does not take toolchain into account
#64 BinaryModuleInfoParser.parse does not take toolchain into account
rfscholte commentedon Feb 15, 2021
Please verify https://github.com/codehaus-plexus/plexus-languages/tree/jdk9%2BwithJdkHome
torakiki commentedon Feb 15, 2021
Yes, both the test repo and my actual repo are compiling fine
#64 BinaryModuleInfoParser.parse does not take toolchain into account
rfscholte commentedon Feb 15, 2021
Fixed with 249f8bd