我创建一个Jenkins管道,我需要发布在artifactory使用artifactory插件buildInfo,这个项目有自己的POM内的子模块。
我的管道和这个差不多
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git 'https://github.com/example/repo.git'
}
}
stage('Build and Publish') {
steps {
script {
def server = Artifactory.server('artifactory-server')
def rtMaven = Artifactory.newMavenBuild()
rtMaven.deployer releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local', server: server
rtMaven.resolver releaseRepo: 'libs-release', snapshotRepo: 'libs-snapshot', server: server
rtMaven.deployer.deployArtifacts = true
def buildInfo = rtMaven.run pom: 'pom.xml', goals: 'clean install'
// Publish build info to Artifactory
server.publishBuildInfo buildInfo
}
}
}
}
}
字符串
I keep getting this exception
型
Caused by: java.lang.NullPointerException
at org.jfrog.build.extractor.maven.BuildInfoRecorder.addDependenciesToCurrentModule(BuildInfoRecorder.java:619)
at org.jfrog.build.extractor.maven.BuildInfoRecorder.addModuleToBuild(BuildInfoRecorder.java:466)
at org.jfrog.build.extractor.maven.BuildInfoRecorder.finalizeModule(BuildInfoRecorder.java:389)
at org.jfrog.build.extractor.maven.BuildInfoRecorder.projectSucceeded(BuildInfoRecorder.java:208)
型
任何想法如何避免这种异常或一种方法来覆盖NPE在BuildInfoRecorder?
我使用Artifactory插件3.18.3和使用Jenkins 2.397
1条答案
按热度按时间wtzytmuj1#
我将Maven版本更改为3.5,它可以正常工作