square / gifencoder

A pure Java library implementing the GIF89a specification. Suitable for use on Android.
Apache License 2.0
666 stars 75 forks source link

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

Closed rendaw closed 5 years ago

rendaw commented 5 years ago

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 commented 5 years ago

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

JakeWharton commented 5 years ago

Released as 0.10.1.

rendaw commented 5 years ago

Works perfectly, thanks again!