GoogleContainerTools/jib

Upgrade ASM to support Java 13

TapaniRundgren opened this issue · 4 comments

OS: Windows 10 (1903)
Maven: 3.6.2
Java: 13
JIB: 1.6.1
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.6.1:dockerBuild (default-cli) on project user: Execution default-cli of goal com.google.cloud.tools:jib-maven-plugin:1.6.1:dockerBuild failed: Unsupported class file major version 57

Wonder if it's the asm tool. If you explicitly specify a main class in your pom.xml, does it work?

Can you also provide a more detailed error message. Use -X I think

I was able to reproduce and it's due to ASM:

Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 57
    at org.objectweb.asm.ClassReader.<init> (ClassReader.java:184)
    at org.objectweb.asm.ClassReader.<init> (ClassReader.java:166)
    at org.objectweb.asm.ClassReader.<init> (ClassReader.java:152)
    at org.objectweb.asm.ClassReader.<init> (ClassReader.java:273)
    at com.google.cloud.tools.jib.frontend.MainClassFinder.findMainClass (MainClassFinder.java:193)
    at com.google.cloud.tools.jib.frontend.MainClassFinder.find (MainClassFinder.java:162)
    at com.google.cloud.tools.jib.plugins.common.MainClassResolver.findMainClassInClassFiles (MainClassResolver.java:120)
    at com.google.cloud.tools.jib.plugins.common.MainClassResolver.resolveMainClass (MainClassResolver.java:60)
    at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.computeEntrypoint (PluginConfigurationProcessor.java:279)
    at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.processCommonConfiguration (PluginConfigurationProcessor.java:193)
    at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.processCommonConfigurationForDockerDaemonImage (PluginConfigurationProcessor.java:81)

@TapaniRundgren the build will succeed if you explicitly specify the mainClass either in your pom or from the command-line with -Djib.container.mainClass=fully.qualified.type.name.

perhaps we can update asm for java 13/14 - https://asm.ow2.io/versions.html

maybe just 13... 14 support is in a beta release.

@TapaniRundgren We've released 1.7.0, which now infers the main class correctly for Java 13/14 projects.