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?
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:
versions-maven-plugin:set
plugin goal.<scm>
element of your POM.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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With