【发布时间】:2019-04-20 03:23:14
【问题描述】:
我看到您可以向 maven Pom 添加目标,以将工件存档到 repo 管理器,例如 nexus
https://www.baeldung.com/maven-deploy-nexus
distributionManagement>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
但 Jenkins 也允许您从管道本身执行此操作
https://wiki.jenkins.io/plugins/servlet/mobile?contentId=96076078#content/view/96076078
freeStyleJob('NexusArtifactUploaderJob') {
steps {
nexusArtifactUploader {
nexusVersion('nexus2')
protocol('http')
nexusUrl('localhost:8080/nexus')
groupId('sp.sd')
version('2.4')
repository('NexusArtifactUploader')
credentialsId('44620c50-1589-4617-a677-7563985e46e1')
artifact {
artifactId('nexus-artifact-uploader')
type('jar')
classifier('debug')
file('nexus-artifact-uploader.jar')
}
artifact {
artifactId('nexus-artifact-uploader')
type('hpi')
classifier('debug')
file('nexus-artifact-uploader.hpi')
}
}
}
}
这两种方法有什么区别,是更常用的一种吗?
【问题讨论】:
标签: maven jenkins pom.xml nexus artifacts