ASSERT-KTH / depclean

DepClean automatically detects and removes unused dependencies in Maven projects (https://dx.doi.org/10.1007/s10664-020-09914-8)
MIT License
244 stars 28 forks source link

Failed to run on Java 21 #278

Open anbusampath opened 7 months ago

anbusampath commented 7 months ago

Execution default-cli of goal se.kth.castor:depclean-maven-plugin:2.0.6:depclean failed: Unsupported class file major version 65

andresnssbx commented 2 months ago

@anbusampath did you find any solution?

jwachter commented 2 months ago

One solution you should be able to use is to manage the plugin (temporarily) in your project and define newer Versions of the ASM Libraries as direct plugin dependencies. As the error only stems from ASM not being able to read the newer bytecode it is enough to use an up-to-date version that supports the newer bytecode levels.

<pluginManagement>
      <plugins>
        <plugin>
          <groupId>se.kth.castor</groupId>
          <artifactId>depclean-maven-plugin</artifactId>
          <version>2.0.6</version>
          <dependencies>
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm-util</artifactId>
                <version>9.7</version>
            </dependency>
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm-tree</artifactId>
                <version>9.7</version>
            </dependency>
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm-commons</artifactId>
                <version>9.7</version>
            </dependency>
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm</artifactId>
                <version>9.7</version>
            </dependency>
          </dependencies>
        </plugin>
  ...
  </plugins>
</pluginManagement>