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

Support using ${revision} as the project version #151

Closed
Froodulous opened this issue Feb 6, 2019 · 9 comments · Fixed by #170
Closed

Support using ${revision} as the project version #151

Froodulous opened this issue Feb 6, 2019 · 9 comments · Fixed by #170

Comments

@Froodulous
Copy link

As of version 3.5, maven supports using the ${revision} placeholder as the version of your project. This is useful in a multi-module project where I want to have a consistent version between all of the modules in the project and have some dependency management for the modules' versions.

Currently this gitflow plugin does not work with this approach - it is unable to parse the version from the pom when starting a release.

I can use the maven flatten plugin to flatten the pom before starting a release. This provides the release plugin with a proper version number and it can start the release, but it is not able to update the "revision" property in the pom to match the release version.

Is there any way to update the gitflow plugin to support this approach?

@aleksandr-m
Copy link
Owner

So you have revision property in your pom and you want to update it after the release, correct?

@Froodulous
Copy link
Author

As an example of what I am trying to do, see how Spring Boot stores the version of the project in the revision property here: https://github.com/spring-projects/spring-boot/blob/master/pom.xml.

Rather than updating the revision property after the release, I would like to update it during the release instead of changing the project version directly.

@aleksandr-m
Copy link
Owner

@Froodulous That is clear. The question is: Do you want to change revision property in pom file?
Suppose you have in the pom <revision>1.2.0</revision>, and you execute mvn gitflow:release -Drevision=1.3.0. Do you want to update <revision> in pom to 1.3.0 in production branch and to 1.3.1-SNAPSHOT in development branch?

@Froodulous
Copy link
Author

That would be ideal, yes.

@lukelalo
Copy link
Contributor

+1 for this issue. versions-maven-plugin and tycho-versions-plugin support this feature

@limkinZero
Copy link

+1 In spring boot starters kind projects this feature help to manage the version correctly

@aleksandr-m
Copy link
Owner

aleksandr-m commented Apr 25, 2019

@Froodulous Steps to support revision in version:

1. Use flatten plugin Since 1.14.0 this is not needed anymore.
2. Set skipUpdateVersion to true
3. Set versionProperty to revision

Should work. :)

@aleksandr-m
Copy link
Owner

@Froodulous @lukelalo @limkinZero 1.13.0 is released. Give it a try.

@Froodulous
Copy link
Author

@aleksandr-m Sorry for the delay replying to this. It works great for me. Thanks a lot for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants