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

Use Maven enforcer for Java and Maven minimum versions #789

Merged
merged 1 commit into from
May 21, 2024

Conversation

Bananeweizen
Copy link
Contributor

@Bananeweizen Bananeweizen commented May 21, 2024

What's changed?

  • Use Maven enforcer to clearly indicate the need for Java 17 during build, as the usage of Java 8 on the classpath may lead to confusion.
  • Also enforce the same minimum Maven version as used in the Maven wrapper to ensure both mvn and mvnw create similar output.

What's your motivation?

If one tries to build on a JDK less than 17, the error messages are rather confusing (because the maven compiler plugin complains about some unknown symbols only). Make the error more obvious by using Maven enforcer instead.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

* Use Maven enforcer to clearly indicate the need for Java 17 during
build, as the usage of Java 8 on the classpath may lead to confusion.
* Also enforce the same minimum Maven version as used in the Maven
wrapper to ensure both mvn and mvnw create similar output.
@timtebeek timtebeek self-requested a review May 21, 2024 15:13
@timtebeek timtebeek added documentation Improvements or additions to documentation enhancement New feature or request labels May 21, 2024
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Should indeed help prevent puzzling warnings when mismatched versions are used.

@timtebeek timtebeek merged commit c890aaa into openrewrite:main May 21, 2024
1 check passed
@Bananeweizen Bananeweizen deleted the enforcer branch May 21, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants