-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Detect Maven version in the dev mojo #1379
Detect Maven version in the dev mojo #1379
Conversation
String mavenVersion = session.getSystemProperties().getProperty("maven.version"); | ||
getLog().debug("Detected Maven Version: " + mavenVersion); | ||
DefaultArtifactVersion detectedVersion = new DefaultArtifactVersion(mavenVersion); | ||
mavenVersionEnforcer.enforce(getLog(), "3.5.3", detectedVersion); |
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.
Wondering if we could find a way to push this from the POM instead of having it hard coded so that we are sure it's consistent with the version restriction we have in the build?
Maybe a filtered .properties
file included in the Maven plugin artifact?
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.
We can extract it and read it from a property file. We already have a few properties like that (they have been moved apparently). Let me revisit this.
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.
Done! Can you have another look @gsmet
dbb0527
to
ddf09f0
Compare
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.
@cescoffier I added a couple of comments.
build-parent/pom.xml
Outdated
@@ -44,6 +44,14 @@ | |||
|
|||
<!-- Enable APT by default for Eclipse --> | |||
<m2e.apt.activation>jdt_apt</m2e.apt.activation> | |||
|
|||
<maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.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.
Is there a reason why you enforce this? Isn't it handled by jboss-parent?
devtools/maven/pom.xml
Outdated
<dependency> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>${maven-enforcer-plugin.version}</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.
I think Georges was talking about this plugin. And indeed it doesn't seem useful now?
build-parent/pom.xml
Outdated
Supported Maven versions, interpreted as a version range | ||
For instance 3.5.3 => [3.5.3,) | ||
--> | ||
<supported-maven-versions>3.5.3</supported-maven-versions> |
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.
I think I would make the value a range ([3.5.3,)
) for more clarity.
This is a result of a discussion on Twitter and was the reason behind quarkusio/quarkus-quickstarts#88. This PR detects the current version and checks it's greater or equal than 3.5.3 (min version required). If not an error is printed explaining the issue.
Use the filtered properties to retrieve the supported versions
@cescoffier could you take a look at my comments and see if you want to make changes? |
Me forgot to push.... |
Use version range for the enforcer rule
ddf09f0
to
7965b19
Compare
@gsmet I've updated the PR |
This is a result of a discussion on Twitter and was the reason behind quarkusio/quarkus-quickstarts#88.
This PR detects the current version and checks it's greater or equal than 3.5.3 (min version required). If not an error is printed explaining the issue.