jeremylong / class-file-format-rule Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED: consider using org.codehaus.mojo:extra-enforcer-rules.
License: Apache License 2.0
DEPRECATED: consider using org.codehaus.mojo:extra-enforcer-rules.
License: Apache License 2.0
As can be observed in the failed builds of DependencyCheck dependabot PRs for the maven-enforcer-plugin update from 3.0.0-M3 to 3.0.0 the class-file-format-rule is triggering errors as it depends on an old maven-dependency-tree library (2.2) and maven enforcer plugin depends on a modern edition of it (3.1.0), resulting in a NoSuchMethodException for this rules-plugin's usage of dependency graph traversal logic.
For all dependencies, which are compiled for Java releases before 9, but still be able to facilitate the Java9+ module system will be rejected if a supportedClassFileFormat of 52 or lower is been enforced.
This is the case as the module-info.class must use class file format of 53 or higher, even if all other classes are satisfying the desired class file format.
As more and more libraries will be compiled using Java 7/8, but with Java 9 module-info been present, they will be rejected if the enforced supportedClassFileFormat is not 53 or higher.
Example:
Using <supportedClassFileFormat>52</supportedClassFileFormat>
leads to the following issues even thought these dependencies are compiled for Java 7 or 8, but with Java 9 module support:
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-classfileformat) @ example ---
[WARNING] Rule 0: org.owasp.maven.enforcer.rule.ClassFileFormatRule failed with message:
The following dependencies exceed the maximum supported JVM class file format (i.e. they were compiled for a newer JVM then this project supports):
com.fasterxml.jackson.core:jackson-core:2.10.1
com.fasterxml.jackson.core:jackson-databind:2.10.1
javax.ws.rs:javax.ws.rs-api:2.1.1
com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.10.1
jakarta.xml.bind:jakarta.xml.bind-api:2.3.2
org.jvnet.mimepull:mimepull:1.9.11
org.glassfish.jersey.core:jersey-common:2.29.1
jakarta.ws.rs:jakarta.ws.rs-api:2.1.6
com.fasterxml.jackson.core:jackson-annotations:2.10.1
A new option to ignore the Java 9+ module-info.class
and any class in the META-INF/versions/<n>
should probably be added to support multi Java Version module JAR files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.