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.
- The pom.xml file was changed from 1.2-SNAPSHOT to 1.2 and a commit was performed and a git tag was created at to tag that release.
- The pom.xml file was then changed to 1.3-SNAPSHOT to ready the git branch to be used for subsequent development.
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:
- You can't do that.
- Just take off the
release:performand only runrelease:prepare. I'm testing this now. - Add the flag -DmavenReleasePluginDontPushToNexus=true. I'm making this up but wondering if there is a flag.
I've looked for solutions to all the above and haven't found an answer yet.
Searching for solution
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:performbased on reading this!Docs for
release:performgoal. 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.