Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strict option to EnforceBytecodeVersion to not ignore module-info and Multi-Release JAR classes #205

Merged

Conversation

Mooninaut
Copy link

I need to deploy a web application to a servlet container that bundles an obsolete version of ASM, which throws an exception when it encounters any Java 9+ class files. Even a harmless module-info.class in a dependency causes the deployment to fail. I would like to use the enforceByteCodeVersion rule to prevent breaking the app, but currently the rule automatically ignores module-info.class and Multi-Release JAR classes.

This PR adds:

  • A strict option to the enforceBytecodeVersion rule that causes the rule to fail when a module-info.class and / or Multi-Release JAR class with a prohibited bytecode version is detected
  • Documentation for the strict option
  • Integration tests for the strict option

@slawekjaranowski
Copy link
Member

Please follow Maven code style for xml
https://maven.apache.org/developers/conventions/code.html

@Mooninaut
Copy link
Author

Please follow Maven code style for xml https://maven.apache.org/developers/conventions/code.html

Updated. Please note that many of the existing integration test pom.xml files do not follow Maven code style.

@slawekjaranowski
Copy link
Member

Updated. Please note that many of the existing integration test pom.xml files do not follow Maven code style.

I know, but new files can be better ... thanks.

last request - please squash to one final commit.

@slawekjaranowski slawekjaranowski self-assigned this Jun 6, 2022
@Mooninaut
Copy link
Author

last request - please squash to one final commit.

Done!

@slawekjaranowski slawekjaranowski merged commit a41a85d into mojohaus:master Jun 8, 2022
@slawekjaranowski
Copy link
Member

@Mooninaut thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants