jenkins NPE org.jfrog.build.extractor.maven.BuildInfoRecorder.addDependenciesToCurrentModule的异常

vmpqdwk3  于 2023-08-03  发布在  Jenkins
关注(0)|答案(1)|浏览(96)

我创建一个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

wtzytmuj

wtzytmuj1#

我将Maven版本更改为3.5,它可以正常工作

相关问题