How to use properly mvn release:prepare?

12,797

Solution 1

Assuming you accept the defaults release:prepare performs the following

1) build and check all tests pass

2) check there are no SNAPSHOT dependencuies

3) change the version from x.x-SNAPSHOT to x.x

4) push to a tag in SCM

5) change the version for the next iteration to x.(x+1)-SNAPSHOT

So your pom.backUp is the original pom, your pom.tag is from step 3 and your pom.next is from step 5.

You can clean up with a mvn release:clean which will be done automatically after a release:perform see maven-release

Solution 2

Maybe it's late, but based on your question you haven't run mvn release:perform after the mvn release:prepare command.

Don't forget to finish your release process with the perform command. https://maven.apache.org/maven-release/maven-release-plugin/plugin-info.html

Or if you don't want to use perform, use should use the mvn release:clean again.

Share:
12,797

Related videos on Youtube

Julien Baldy
Author by

Julien Baldy

Updated on June 04, 2022

Comments

  • Julien Baldy
    Julien Baldy almost 2 years

    I try this command (with dryrun to test) on my Maven project :

    mvn release:clean release:prepare -DdryRun=true -DgenerateBackupPoms=false -Dtag=solocal-refentreprive-2.1-RC02 -DreleaseVersion=2.1-RC02 -DdevelopmentVersion=2.1-SNAPSHOT
    

    At the end, the build is success, but I have (in my commit) many pom.next / pom.tag and pom.backUp...

    I don't when then (-DgenerateBackupPoms=false), if I use without dryrun. I don't want push this pom...

    • Steve C
      Steve C about 7 years
      What version of Maven? What version of the maven release plugin?
    • Mark Adelsberger
      Mark Adelsberger about 7 years
      Several of the tags seem improper; e.g. what has this to do with git?
  • lostintranslation
    lostintranslation over 5 years
    push a tag means pushing to git or just creating a local tag which needs to be explicitly pushed ?
  • Essex Boy
    Essex Boy over 5 years
    @SharadHolani means pushing the tag to the remote SCM
  • lostintranslation
    lostintranslation over 5 years
    I run the maven release plugin. But I dont see any new tags being pushed to my remote git. I can see that it has made 2 local commits as described in step 3 and 5. Also, I can see the tag being created locally when I run git describe --tags. Don't I need to run git push to push that tag created in step 4 to remote git ?