I have user-level access to Jenkins and cannot change the settings.xml for Maven due to access restrictions. When I want to mvn deploy, it expects to have a distributionManagement clause in the pom.xml. The code however comes from the internet and I rather don't change the pom.xml every time. Is there something I can do in Jenkins? I am considering using the Artifactory plugin because that is where I want to deploy.
I'd recommend using mvn deploy from Jenkins, but specifying the repository to deploy to with the -DaltDeploymentRepository=id::layout::url system property.
Format: id::layout::url
id is the repository id to be used to get credentials from the settings.xml (ie central, snapshot)
layout should be "default", unless you are still using Maven1 (in which case it should be "legacy")
url is the URL for the repository you want to deploy to.
This is specified in the Maven documentation here: https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.