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

Remove implicitly-included java.base dep in module-info #18

Merged
merged 1 commit into from
Sep 30, 2019

Conversation

rendaw
Copy link

@rendaw rendaw commented Sep 29, 2019

It looks like java.base is an implicit requirement and explicitly requiring it raises an error here.

I've confirmed that removing the requires allows a minimal test project to compile and run.

The place I encountered this was using maven-compiler-plugin 3.8.0 in the compile goal:

Caused by: java.lang.module.InvalidModuleDescriptorException: Dependence upon java.base already declared
    at jdk.internal.module.ModuleInfo.invalidModuleDescriptor (ModuleInfo.java:1092)
    at jdk.internal.module.ModuleInfo.read (ModuleInfo.java:134)
    at java.lang.module.ModuleDescriptor.read (ModuleDescriptor.java:2508)
    at org.codehaus.plexus.languages.java.jpms.BinaryModuleInfoParser.parse (BinaryModuleInfoParser.java:35)
    at org.codehaus.plexus.languages.java.jpms.AbstractBinaryModuleInfoParser.getModuleDescriptor (AbstractBinaryModuleInfoParser.java:84)
    at org.codehaus.plexus.languages.java.jpms.LocationManager.resolvePaths (LocationManager.java:127)
    at org.apache.maven.plugin.compiler.CompilerMojo.preparePaths (CompilerMojo.java:239)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:787)

I'd like to believe that this was a recent change or due to some unfortunate combination of plugin/jvm/target versions but AFAICT this happens with Java 9+ with target of Java 9+ so I'd need to apologize for the bad PR before. I'm not sure why I added it originally.

@dlubarov
Copy link
Collaborator

LGTM -- I'm not really familiar with Java 9 modules but your explanation makes sense.

@JakeWharton JakeWharton merged commit 7c5bdae into square:master Sep 30, 2019
@JakeWharton
Copy link
Collaborator

Released as 0.10.1.

@rendaw
Copy link
Author

rendaw commented Oct 13, 2019

Works perfectly, thanks again!

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

Successfully merging this pull request may close these issues.

3 participants