e-gineering / gitflow-helper-maven-plugin

An extension and plugin that teaches Maven to work well with gitflow projects and CI servers.
Apache License 2.0
76 stars 21 forks source link

Enhancement: Create a goal to expose the project version string #95

Closed bvarner closed 6 years ago

bvarner commented 6 years ago

Chaining executions allows to use the maven-help-plugin and extract the '${project.version}' but it's not very elegant, and it doesn't play well with Jenkins pipeline builds -- where the maven wrapper spits a bunch of junk out standard out, leaving you with incredibly complex shell scripts that take way too long to properly escape. I've spent too much time on this already without success.

I ended up writing a test resource that gets filtered by the build and spits ${project.version} into the contents of a file. It would be nice if there were a goal to create such a marker file in the target directory without it needing to be part of the artifacts for a project.

This could then be picked up by later stages of pipeline builds, and would be much easier to work with.

Along with this, it would be nice to set a tag / version massage semantic. Using a '+' as a delimiter breaks the ability to use the version as a docker image tag.

bvarner commented 6 years ago

No need to make this a goal. If it's really needed, you can add a resource filtering to write the ${project.version} out to a file.

The actual change that should be made, would be to add configuration property to change the otherBranchVersionDelimiter from + to something else.