Is there any way to disable the maven-deploy-plugin deployment target via settings.xml

I tried adding this to settings.xml;

<properties> <maven.deploy.skip>true</maven.deploy.skip> </properties> 

But that did not work. mvn deploy -Dmaven.skip.deploy = true seems to work fine. I also assume that adding the above tag to pom.xml will also work. Is there a way to achieve this using settings.xml?

The reason I want to do this is to get people to generate Jenkins jobs in order to use the Jenkins method to deploy artifacts and not use the deployment target. The Jenkins method will deploy artifacts only when the whole assembly is successful, but the deployment target can deploy artifacts even when the rest of the assembly is about to fail. I am open to suggestions on other ways to achieve this, except that regular users cannot create and configure tasks in Jenkins.

+8
source share
4 answers

It turned out how to do this using settings.xml. I had to insert the tags that I mentioned in the active profile.

+2
source

One way that should work if -Dmaven.skip.deploy=true really works for you is:

In setting up the Jenkins job, go to Build to Advanced ... and enter -Dmaven.skip.deploy=true in the MAVEN_OPTS field.

+2
source

The following worked for me after a long battle.

  -Dskip.deploy=true 

The following did not work.

 -Dmaven.skip.deploy=true -Dmaven.deploy.skip=true 
+1
source

I found that this works with

-Dmaven.deploy.skip = true

instead

-Dmaven.skip.deploy = true

0
source

Source: https://habr.com/ru/post/1435445/


All Articles