Uploaded image for project: 'Maven Shade Plugin'
  1. Maven Shade Plugin
  2. MSHADE-337

Relocation cannot process class file version 58 JARs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.1
    • 3.2.2
    • None

    Description

      I was playing around with Java 14 and was making a shaded JAR. The shade plugin seems to work fine but if I add a relocation it throws:

      java.lang.IllegalArgumentException: Unsupported class file major version 58
      

      Steps to Reproduce:

      • Unzip the enclosed attachment
      • Make sure Java 14 is installed and JAVA_HOME points at it
      • Run mvn package

      Stacktrace:

      Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 58
          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 org.apache.maven.plugins.shade.DefaultShader.addRemappedClass (DefaultShader.java:438)
          at org.apache.maven.plugins.shade.DefaultShader.shadeSingleJar (DefaultShader.java:240)
          at org.apache.maven.plugins.shade.DefaultShader.shadeJars (DefaultShader.java:196)
          at org.apache.maven.plugins.shade.DefaultShader.shade (DefaultShader.java:106)
          at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute (ShadeMojo.java:442)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
      

      Notes:

      • I tried to make the example as minimal as possible
      • The relocation patterns don't see to matter. The issue is in the relocator code opening a JAR dependency I guess

      Attachments

        1. shade-bug.zip
          10 kB
          Jordan Zimmerman

        Issue Links

          Activity

            People

              khmarbaise Karl Heinz Marbaise
              randgalt Jordan Zimmerman
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: