-
Notifications
You must be signed in to change notification settings - Fork 23
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
[MPOM-289] Use properties to define the versions of plugins #155
Conversation
<apacheRatPluginVersion>0.15</apacheRatPluginVersion> | ||
<mavenAntrunPluginVersion>3.1.0</mavenAntrunPluginVersion> | ||
<mavenAssemblyPluginVersion>3.6.0</mavenAssemblyPluginVersion> | ||
<mavenCleanPluginVersion>3.2.0</mavenCleanPluginVersion> | ||
<mavenCompilerPluginVersion>3.11.0</mavenCompilerPluginVersion> | ||
<mavenDependencyPluginVersion>3.6.0</mavenDependencyPluginVersion> | ||
<mavenDeployPluginVersion>3.1.1</mavenDeployPluginVersion> | ||
<mavenEarPluginVersion>3.3.0</mavenEarPluginVersion> | ||
<mavenEnforcerPluginVersion>3.3.0</mavenEnforcerPluginVersion> | ||
<mavenGpgPluginVersion>3.1.0</mavenGpgPluginVersion> | ||
<mavenHelpPluginVersion>3.4.0</mavenHelpPluginVersion> | ||
<mavenInstallPluginVersion>3.1.1</mavenInstallPluginVersion> | ||
<mavenInvokerPluginVersion>3.5.1</mavenInvokerPluginVersion> | ||
<mavenJarPluginVersion>3.3.0</mavenJarPluginVersion> | ||
<mavenJavadocPluginVersion>3.5.0</mavenJavadocPluginVersion> | ||
<mavenProjectInfoReportsPluginVersion>3.4.3</mavenProjectInfoReportsPluginVersion> | ||
<mavenReleasePluginVersion>3.0.0</mavenReleasePluginVersion> | ||
<mavenRemoteResourcesPluginVersion>3.1.0</mavenRemoteResourcesPluginVersion> | ||
<mavenResourcesPluginVersion>3.3.1</mavenResourcesPluginVersion> | ||
<mavenScmPluginVersion>2.0.1</mavenScmPluginVersion> | ||
<mavenScmPublishPluginVersion>3.2.1</mavenScmPublishPluginVersion> | ||
<mavenShadePluginVersion>3.4.1</mavenShadePluginVersion> | ||
<mavenSitePluginVersion>3.12.1</mavenSitePluginVersion> | ||
<mavenSourcePluginVersion>3.3.0</mavenSourcePluginVersion> | ||
<mavenWarPluginVersion>3.3.2</mavenWarPluginVersion> |
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 idea is nice, but can we use a naming convention that is more sortable, and groups version-related properties apart from other properties, and uses the artifact name as part of the property, so it's easy to grep for these? Something like maven-release-plugin -> version.maven-release-plugin
.
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 want to reuse those values in many place also in documentation in .vm files ... but we can not use 'dot' for velocity templates.
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.
@slawekjaranowski The maven-site-plugin documentation says you can use $context.get("my.property")
, so that's not a problem.
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.
@ctubbsii I know such workarounds for sitedocs ... but I would like to use properties as simply as possible without additional hacks.
So I will merge as is - if no more objections.
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 stand by my objection that I think the naming convention could be better... even if you choose not to use dots, using the same name as the plugin artifact and using the word "version" as the prefix rather than the suffix, is better for quickly finding these. It wasn't a problem when there were only a few, but as you're making a bunch of them, keeping them organized becomes more important.
I still think the workaround for the dot in the velocity templates is not a problem... I don't think this should cater to that edge case, because dots are common in Maven and Java, even if velocity doesn't like them. But, even if you do cater to that edge case, there's plenty of ways to improve the naming scheme without using dots.
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.
+1 for dots
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 see that more of us is for using dots, and we have also idea for prefix.
So what do you think about:
version.<artifactId>
- like: version.maven-release-plugin
- thanks @ctubbsii 😄
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.
perso I usually use <artifactId>.version
such <maven-release-plugin.version>
it looks more similar to object.property
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.
perso I usually use
<artifactId>.version
such<maven-release-plugin.version>
it looks more similar toobject.property
+1
What about the old properties ?
<surefire.version>3.1.0</surefire.version><!-- for surefire, failsafe and surefire-report -->
<maven.plugin.tools.version>3.9.0</maven.plugin.tools.version>
Are you going to change them to be consistent with the new ones ? Any concerns about backward compatibility ?
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 would suggest keeping any existing ones, and only following a consistent convention for new ones, for now. Changing the existing ones to follow the same convention (with a possible attempt for backwards compatibility, through the use of property referencing another property, or through a profile activated using the legacy property, or something else), could be done in a subsequent PR, if somebody wanted to do it. For now, it would be enough to just establish the convention using new properties.
I like the idea. Then it will be possible to use interpolation in it pom files to use same version and avoid some download. |
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.
Looks good, I don't have any particular opinion about the naming...
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.
Very nice!
This comment was marked as resolved.
This comment was marked as resolved.
I use Using a hierarchical naming scheme gives you an opportunity to sort those (e.g. with the sortpom plugin - https://github.com/Ekryd/sortpom) and not have the versions strewn all over the place (the names all align on |
is there a GH issue opened about that? |
You can use: |
Thanks @slawekjaranowski ! That's good to know. |
<surefire.version>3.1.0</surefire.version><!-- for surefire, failsafe and surefire-report --> | ||
<maven.plugin.tools.version>3.9.0</maven.plugin.tools.version><!-- for m-plugin-p and maven-plugin-annotations --> | ||
<assembly.tarLongFileMode>posix</assembly.tarLongFileMode> | ||
|
||
<!-- plugins versions --> | ||
<apacheRatPluginVersion>0.15</apacheRatPluginVersion> | ||
<mavenAntrunPluginVersion>3.1.0</mavenAntrunPluginVersion> | ||
<mavenAssemblyPluginVersion>3.6.0</mavenAssemblyPluginVersion> |
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.
Please stay consistent in Naming: surefire.version
!= mavenAssemblyPluginVersion
.
If velocity has problems, let's fix velocity. In freemarker we could just use another syntax, I expect velocity to have the same ability. 3rd party tools (ie non-maven) should not have impact on naming.
We can have endless debates about a format, at the end you cannot please everyone. Let's stick to the one we have, it is established and move on. |
Which one exactly ?
|
The first two have been superseded and lead to problems, e.g., |
FWIW I vote for |
Alternate implementation to PR apache#155 to demonstrate my alternative proposal with the naming convention of `version.artifactId` for properties. The properties are sorted in the properties section. This also includes individual properties for the plugins that use `${maven.plugin.tools.version}` and `${surefire.version}`, so they can be set individually, but will default to using the current properties that set the version for multiple plugins at once. This also includes MPOM-407 (PR apache#157) to bump the version of maven-release-plugin, as well as a bugfix version bump for surefire/failsafe and maven-project-info-reports-plugin This also includes a bump of the minimum Maven version, because the current version of maven-help-plugin declares a prerequisite Maven 3.6.3. This also fixes the M2Eclipse profile, `only-eclipse`, to remove the upper bound on the version for maven-remote-resources-plugin, because the version specified in this POM has already exceeded the that upper bound, and the profile would not have been working correctly.
I created an alternate implementation for my ideas from this discussion at #158, that adopts the |
Alternate implementation to PR apache#155 to demonstrate my alternative proposal with the naming convention of `version.artifactId` for properties. The properties are sorted in the properties section. This also includes individual properties for the plugins that use `${maven.plugin.tools.version}` and `${surefire.version}`, so they can be set individually, but will default to using the current properties that set the version for multiple plugins at once. This also fixes the M2Eclipse profile, `only-eclipse`, to remove the upper bound on the version for maven-remote-resources-plugin, because the version specified in this POM has already exceeded the that upper bound, and the profile would not have been working correctly.
suppressed by #158 |
discussion invite sent to release-discuss@apache.org: https://lists.apache.org/list?release-discuss@apache.org:2023-6