Issue
I'm trying to run a java (mvn) project by Jenkins job using the pipeline.
the cloning and the verify success but the deploy doesnt.
this is the error i got:
[main] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project create_pass_criteria: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
i am trining to fix it by adding this code to my pom.xml
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>corp1</id>
<name>Corporate Repository</name>
<url>file:///home/myfolder/.m2</url>
<layout>default</layout>
</repository>
</distributionManagement>
but how can i find the url that i should use ?
Thanks very much.
Solution
Usually you have two different entries in distributionManagement. One for releases and one for snapshots. This the url of your internal repository manager:
<distributionManagement>
<repository>
<name>release repo</name>
<id>releases</id>
<url>https://repomanager.com/base/maven-releases</url>
</repository>
<snapshotRepository>
<name>snapshots repo</name>
<id>snapshots</id>
<url>https://repomanager.com/base/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
The <id>..</id>
references the entries in settings.xml
file for authentication. The credentials should be configured in credentials store of Jenkins... (config file provider plugin in Jenkins is very helpful in such cases)
Answered By - khmarbaise