jenkins上传External jar到nexus仓库
发布日期:2021-10-09 15:34:59 浏览次数:1 分类:技术文章

本文共 1680 字,大约阅读时间需要 5 分钟。

使用jenkins的nexus Artifact Uploader plugin

stage('upload the jar to nexus') {
nexusArtifactUploader nexusVersion: 'nexus2', protocol: 'http', nexusUrl: 'localhost:8080/nexus', groupId: 'sp.sd', version: '2.4', repository: 'NexusArtifactUploader', credentialsId: '44620c50-1589-4617-a677-7563985e46e1', artifacts: [ [artifactId: 'nexus-artifact-uploader', type: 'jar', classifier: 'debug', file: 'nexus-artifact-uploader.jar' ] ]

2.使用maven的deploy插件

node{
stage ('Build') {
git url: 'https://github.com/cyrille-leclerc/multi-module-maven-project' withMaven( // Maven installation declared in the Jenkins "Global Tool Configuration" maven: 'maven-3', // Maven settings.xml file defined with the Jenkins Config File Provider Plugin // We recommend to define Maven settings.xml globally at the folder level using // navigating to the folder configuration in the section "Pipeline Maven Configuration / Override global Maven configuration" // or globally to the entire master navigating to "Manage Jenkins / Global Tools Configuration" mavenSettingsConfig: 'my-maven-settings') {
// Run the maven build sh "mvn deploy:deploy-file -DgroupId=
\ -DartifactId=nexus-artifact-uploader \ -Dversion=1.0.0 \ -Dpackaging=jar \ -Dfile=nexus-artifact-uploader.jar \ -DrepositoryId=releases \ -Durl=http://localhost:8080/nexus" } // withMaven will discover the generated Maven artifacts, JUnit Surefire & FailSafe & FindBugs & SpotBugs reports... }}

转载地址:https://blog.csdn.net/qinwuxian19891211/article/details/105932995 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Axios用法详解
下一篇:Intellij中设置google风格的代码规范

发表评论

最新留言

关注你微信了!
[***.104.42.241]2024年04月10日 01时35分15秒