Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mvn release:prepare failure cleanup

I was building a release using mvn and have seem to hosed things up. This is what I did:

mvn release:prepare -Darguments="-DskipTests=true" -DautoversionSubmodules=true -Dpassword=... -Dusername=...

and it failed due to a incorrect password.

Mistakenly I did a

mvn release:clean

which then blew away my backups preventing me from now doing the correct thing, a

mvn release:rollback.  

This fails with an error saying it cannot restore from a backup.

Is there a way to tell mvn to just start fresh building this release?

like image 631
Scott S Avatar asked Oct 30 '22 15:10

Scott S


1 Answers

When you (mistakenly) invoked mvn release:clean, all of the intermediate back-up files of your project were removed, so Maven can't roll back to the initial state (simply because it doesn't know what the initial state is anymore).

You don't have much options left: you need to restore the initial state yourself. This means:

  • Restoring the project version. This can be done by hand or with the help of the versions-maven-plugin:set plugin goal.
  • Restoring the <scm> element of your POM.
  • Restoring any SNAPSHOT dependencies that you might have had (between modules of a multi-module Maven project for example). This also means updating the <parent> element in case of a multi-module project.

Since you say the release failed because of an incorrect password, I assume it failed during SCM authentication. In that case, you don't need to remove the tag that the release should have created.

Since there is no back-ups, on your next invocation of the maven-release-plugin, it will start a new release from scratch.

And remember for the future: Think before you type!

like image 149
Tunaki Avatar answered Nov 15 '22 14:11

Tunaki