Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BinaryModuleInfoParser.parse does not take toolchain into account #64

Closed
bmarwell opened this issue Feb 10, 2021 · 4 comments
Closed

BinaryModuleInfoParser.parse does not take toolchain into account #64

bmarwell opened this issue Feb 10, 2021 · 4 comments
Milestone

Comments

@bmarwell
Copy link

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

@torakiki
Copy link

torakiki commented 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:

[WARNING] Can't extract module name from classes: Unsupported major.minor version 59.65535
Compilation failure
[ERROR] /home/torakiki/repos/pdf-black/pdfblack-model/src/main/java/module-info.java:[20,22] error: module not found: black.pdf.i18n

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:

[WARNING] Can't extract module name from classes: Unsupported major.minor version 59.0
Compilation failure
[ERROR] /home/torakiki/repos/test/testme-child2/src/main/java/module-info.java:[5,17] error: module not found: test.me.child

From what I can see from the logs child1 module is actually missing from the module path.

@rfscholte
Copy link
Member

Please verify https://github.com/codehaus-plexus/plexus-languages/tree/jdk9%2BwithJdkHome

@torakiki
Copy link

Yes, both the test repo and my actual repo are compiling fine

rfscholte added a commit that referenced this issue Feb 15, 2021
@rfscholte
Copy link
Member

Fixed with 249f8bd

@rfscholte rfscholte added this to the 1.0.7 milestone Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants