JFrog Artifactory 的 Jenkins 管道无法发布 BuildInfo

Jenkins pipeline for JFrog Artifactory fails to publish BuildInfo

Jenkinsfile写在groovy如下:

env.MVN_Goals = MVN_Goals
node {
 // Get Artifactory server instance, defined in the Artifactory Plugin administration page.
def server = Artifactory.newServer url: 'http://localhost:8085/artifactory', username: 'admin', password: 'password'
 // Create an Artifactory Maven instance.
 def rtMaven = Artifactory.newMavenBuild()

 stage ('Clone sources'){
     git url: 'D:/Sample GIT_Maven Repo'
 }

 stage 'Artifactory configuration'
    rtMaven.deployer releaseRepo:'libs-release-local', snapshotRepo:'libs-snapshot-local', server: server
    rtMaven.resolver releaseRepo:'libs-release', snapshotRepo:'libs-snapshot', server: server
    def buildInfo = Artifactory.newBuildInfo()


 stage('Maven_Build'){

 if (isUnix()) {
    sh "D:/apache-maven-3.3.9/bin/mvn -B -Dmaven ${MVN_Goals}"
 }

 else{
    bat "D:/apache-maven-3.3.9/bin/mvn -B -Dmaven ${MVN_Goals}"
 }

 step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
}
stage ('Publish build info'){
     server.publishBuildInfo buildInfo
 }
}

我尝试通过为 Jenkins 添加 Artifactory 插件来在 Jenkins 中配置 Artifactory。当我尝试测试连接时,出现 There is either an incompatible or no instance of Artifactory at the provided URL 错误。当我试图在詹金斯建立我的工作时,同样的错误发生了。有办法解决吗?

Artifactory 插件版本 - 2.9.1

Artifactory 版本 - 4.15.0

def buildInfo = Artifactory.newBuildInfo() 处于该特定阶段。

修改为

env.MVN_Goals = MVN_Goals

node {

// Get Artifactory server instance,
// defined in the Artifactory Plugin administration page.

def server = Artifactory.newServer url: 'http://localhost:8085/artifactory', username: 'admin', password: 'password'

// Create an Artifactory Maven instance.

def rtMaven = Artifactory.newMavenBuild()

def buildInfo = Artifactory.newBuildInfo()

stage ('Clone sources'){

    git url: 'D:/Sample GIT_Maven Repo'
}