-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Manage maven version similarly as the other dependency versions are m… #9353
base: main
Are you sure you want to change the base?
Conversation
@@ -18,7 +18,7 @@ | |||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | |||
|
|||
<maven.version>3.9.5</maven.version> | |||
<maven.version>{{mavenVersion}}</maven.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gzsombor @pascalgrimaud @murdos If maven.version is used to enforce minimum maven version with maven-enforcer-plugin (like in the generator-jhipster), this should be version 3.2.5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielFran I agree. We previously had a similar discussion: #8933 (comment)
I however think that requiring 3.2.5 is way too low. Recent (3.8+) maven versions contains a lot of improvements and it would be a shame to not raise the bar a little.
If we require 3.2.5 version, then the enforce verification doesn't have much value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm going to rename the mavenVersion to 'latestMavenVersion' or something like that, and keep 'enforcer-plugin' as is
@@ -45,6 +45,7 @@ | |||
<archunit-junit5.version>1.2.1</archunit-junit5.version> | |||
<cucumber.version>7.16.1</cucumber.version> | |||
<!-- Maven Plugins --> | |||
<maven.version>3.9.6</maven.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main goal is to have a way to get the current maven/gradle version from a module - as I try to create a jhipster module to create Mise configuration, so I could have a minimal, declarative project setup.
Any alternative idea, how and where can I get those values ? I would rather not duplicate that constant in that module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main issue is that by doing that you're breaking automatic update of maven wrapper.
The source of truth for maven wrapper version in jhipster-lite is src/main/resources/generator/buildtool/maven/.mvn/wrapper/maven-wrapper.properties
since it's handled by our automatic dependencies updater (renovate).
If for your specific needs you need to get the maven wrapper version used by jhipster-lite, you could implement a reader, in your own module, that will extract the version from src/main/resources/generator/buildtool/maven/.mvn/wrapper/maven-wrapper.properties
:
mise/domain/MavenWrapperVersionReader.java
interface MavenWrapperVersionReader {
Version readVersion();
}
implemented by
mise/infractructure/secondary/FilesystemMavenWrapperVersionReader.java
@Component
class FilesystemMavenWrapperVersionReader implements MavenWrapperVersionReader {
@Override
public Version readVersion() {
// load generator/buildtool/maven/.mvn/wrapper/maven-wrapper.properties content from classpath
// using a regexp to extract maven version
}
}
@@ -18,7 +18,7 @@ | |||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | |||
|
|||
<maven.version>3.9.5</maven.version> | |||
<maven.version>{{mavenVersion}}</maven.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielFran I agree. We previously had a similar discussion: #8933 (comment)
I however think that requiring 3.2.5 is way too low. Recent (3.8+) maven versions contains a lot of improvements and it would be a shame to not raise the bar a little.
If we require 3.2.5 version, then the enforce verification doesn't have much value.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9353 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 2937 2938 +1
===========================================
Files 734 734
Lines 12756 12762 +6
Branches 257 257
===========================================
+ Hits 12756 12762 +6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated in this comment this is breaking automatic maven wrapper updates with renovate
…anaged