A
A
Anton2018-11-06 11:32:36
Maven
Anton, 2018-11-06 11:32:36

How do you get a version from a maven project to create a docker tag on release?

The maven-release-plugin maven.apache.org/maven-release/maven-release-plugin/ is used to automate release releases. This plugin modifies the source code in the git repository.

  • remove 'SNAPSHOT' from ${project.version} root pom.xml and all modules (1.0.1-SNAPSHOT -> 1.0.1) and commit
  • adding a tag to a commit with a fixed version (i.e. 1.0.1)
  • commit the new SNAPSHOT version of pom.xml and all modules to the next SNAPSHOT (1.0.1 -> 1.0.2-SNAPSHOT)
  • pushing changes to the Git server

How after the phase "adding a tag to a commit with a fixed version (i.e. to 1.0.1)" do the docker tag command?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2018-11-06
Patsev @chemtech

https://stackoverflow.com/questions/51431684/taggi...
git describe --abbrev=0 --tags

S
Saboteur, 2018-11-06
@saboteur_kiev

1. you can manually take it from the updated pom file in the working directory
2. For example, Teamcity can simply access the %maven.project.version% variable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question