// @Library('dxy-shared-library') _
管道{代理任何//参数{ //文本defaultValue:‘{a’:1,"b":1,2,3}‘’,名称:'meta‘/}
stages {
stage('Hello') {
steps("Git Checkout") {
echo 'Hello World'
echo "${meta}"
script {
def props = readJSON text: meta;
println props
}
}
}
}
}
hudson.remoting.ProxyException: net.sf.json.JSONException: Invalid JSON String
at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:143)
at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:103)
at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:84)
at org.jenkinsci.plugins.pipeline.utility.steps.json.ReadJSONStepExecution.doRun(ReadJSONStepExecution.java:87)
at org.jenkinsci.plugins.pipeline.utility.steps.AbstractFileOrTextStepExecution.run(AbstractFileOrTextStepExecution.java:29)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
完成:失败
发布于 2022-07-21 08:15:33
管道{代理任意
stages {
stage('Hello') {
steps("Git Checkout") {
echo 'Hello World'
echo "${meta}"
script {
def props = readJSON text: meta.replace("'", "");
println props
}
}
}
}
}
https://stackoverflow.com/questions/73062701
复制相似问题