简体   繁体   中英

Recompiling third party Java code in a restricted environment

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 Artifactory plugin seems a good solution if you cannot use the Maven deploy goal.

With a simple mvn clean install command + the Artifactory plugin, you will be able to deploy where you want (if the Jenkins server has the relevant read/write access):

在此处输入图片说明

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM