0
我試圖通過在初始化Groovy腳本來Artifactory的配置添加到詹金斯設置Artifactory的詹金斯的插件,但是我得到以下錯誤通過Groovy腳本
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.jfrog.hudson.ArtifactoryServer(java.lang.String, java.lang.String, org.jfrog.hudson.util.Credentials, org.jfrog.hudson.util.Credentials, java.lang.Integer, java.lang.Boolean)
我運行的代碼如下
詹金斯版本:2.46.3 Artifactory的插件版本:2.11.0
import jenkins.model.*
import org.jfrog.*
import org.jfrog.hudson.*
import org.jfrog.hudson.util.Credentials;
def inst = Jenkins.getInstance()
def desc = inst.getDescriptor("org.jfrog.hudson.ArtifactoryBuilder")
def deployerCredentials = new Credentials("admin", "password")
def resolverCredentials = new Credentials("", "")
def sinst = [new ArtifactoryServer(
"server-id",
"http://localhost:8081/artifactory",
deployerCredentials,
resolverCredentials,
300,
false)
]
desc.setArtifactoryServers(sinst)