I tried adding this to the settings.xml;
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
But that didn't work. mvn deploy -Dmaven.skip.deploy=true seems to work ok. Also I assume that adding the above tag to the pom.xml would work also. Is there a way to achieve this using the settings.xml?
Reason for me to want to do this is to force people generating Jenkins jobs to have to use the Jenkins' method for deploying artifacts and not use the deploy goal. The Jenkins' method will deploy the artifacts only when the whole build has succeeded, but the deploy goal can deploy artifacts even when the rest of the build is about to fail. I'm open to suggestions on other ways to achieve this apart from preventing normal users from creating and configuring jobs in Jenkins.
Goals Overview deploy:deploy is used to automatically install the artifact, its pom and the attached artifacts produced by a particular project. Most if not all of the information related to the deployment is stored in the project's pom. deploy:deploy-file is used to install a single artifact along with its pom.
clean : removes files generated at build-time in a project's directory ( target by default) install : installs the package into the local repository, for use as a dependency in other projects locally.
The maven deploy plugin can be used to deploy either files or projects to the remote repository for sharing it with other developers and projects. There are various methods can be used to deploy your artifact to the remote repository by using a maven deploy plugin.
mvn:install copies your packaged Maven module to your local repository (by default, in ~/. m2/repository ), to be accessed by other local Maven builds. mvn:deploy uploads your packaged Maven module to another (usually remote) repository, to be accessed by other, not necessarily local, Maven builds.
The following worked for me after a long battle.
-Dskip.deploy=true
The following didn't work.
-Dmaven.skip.deploy=true
-Dmaven.deploy.skip=true
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