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

Detect Maven version in the dev mojo #1379

Merged
merged 4 commits into from
Mar 13, 2019

Conversation

cescoffier
Copy link
Member

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.

@cescoffier cescoffier requested a review from gsmet March 10, 2019 18:43
devtools/maven/pom.xml Outdated Show resolved Hide resolved
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);
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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

@gsmet gsmet added the kind/enhancement New feature or request label Mar 11, 2019
@cescoffier cescoffier force-pushed the features/detect-maven-version branch from dbb0527 to ddf09f0 Compare March 11, 2019 15:10
Copy link
Member

@gsmet gsmet left a 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.

@@ -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>
Copy link
Member

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?

<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
Copy link
Member

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?

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>
Copy link
Member

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
@gsmet
Copy link
Member

gsmet commented Mar 12, 2019

@cescoffier could you take a look at my comments and see if you want to make changes?

@cescoffier
Copy link
Member Author

Me forgot to push....

@cescoffier cescoffier force-pushed the features/detect-maven-version branch from ddf09f0 to 7965b19 Compare March 12, 2019 11:12
@cescoffier
Copy link
Member Author

@gsmet I've updated the PR

@gsmet gsmet merged commit 1dc489f into quarkusio:master Mar 13, 2019
@gsmet gsmet added this to the 0.12.0 milestone Mar 15, 2019
@cescoffier cescoffier deleted the features/detect-maven-version branch January 21, 2020 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants