I've got a java application that I want to follow the typical maven release cycle with, but I don't want or need to push the application to Nexus (or maven central).
When I run
mvn release:prepare release:perform -Darguments="-DskipTests=true -Dmaven.javadoc.skip=true"
I get an error during the perform stage that says the pom.xml file was missing the <distributionManagement> definitions required to push the built artifacts to NEXUS (our internal maven repo).
I'm using git and when I use git log I can see that all the other steps that I wanted to perform were performed properly.
So... everything looks good. All I want to do is to tell maven not to try to do the push so the command completes without an error.
NOTE: A couple files from release:prepare were left around, one was release.properties, but I can live with manually deleting that if necessary.
Some solutions I'm looking for are:
release:perform and only run release:prepare. I'm testing this now.I've looked for solutions to all the above and haven't found an answer yet.
Maven Release Plugin
The maven release plugin documentation is at http://maven.apache.org/maven-release/maven-release-plugin/plugin-info.html. It looks like I don't want to use release:perform based on reading this!
Docs for release:perform goal. http://maven.apache.org/maven-release/maven-release-plugin/examples/perform-release.html - pretty useless.
https://maven.apache.org/guides/mini/guide-releasing.html - A pretty good guide on how to use the maven release plugin.
Stack Overflow Searches
How to setup the Maven release plugin with git - Poor person never got his question answered. Viewed 16K times!
Maven release plugin 2.2.2 doesn't push to distributionmanagement - This looked promising but basically says it should push and says to add <distributionManagement> elements to define where you want to push things to. Since I don't want to do this I'm not adding this definition.
Hudson and maven-release-plugin - OP was trying figure out how to use maven release plugin with hudson. It didn't help.
https://stackoverflow.com/search?q=%5Bmaven%5D+release - a search for questions with the maven tag and the word release. Too many results to be useful (over 10,000).
https://stackoverflow.com/search?q=%5Bmaven%5D+release+push - Now down to 300 results, better but I didn't find an answer.
My guess is that this has been asked and answered before but so far I can't find it.
You can do this by changing the goal to install, by default it is deploy:
<artifactId>maven-release-plugin</artifactId>
<configuration>
<goals>install</goal>
</configuration>
Also, I think you can ignore perform totally, because the updating and committing of BOTH release version and new development versions are done by prepare step: maven release plugin doc
I confirm, the release:prepare phase will:
The only missing step from release:perform that you might need is the increment of the version to the next SNAPSHOT, transforming the release version to a new snapshot, in order to prepare for the next batch of work.
Using version:set will be required.
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