java.lang.NoSuchMethodError: 没有这样的 DSL 方法“readJSON" [英] java.lang.NoSuchMethodError: No such DSL method 'readJSON'
本文介绍了java.lang.NoSuchMethodError: 没有这样的 DSL 方法“readJSON"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
def data = readJSON text: '{"rel" : {"configVersion": "1.0","manifest" :"'+"${manifestURL}"+'"}}'
writeJSON(file: 'C:\Users\Public\json\config.json', json: data)
我在我的 Jenkins 管道中使用 JSON 函数并获得 NoSuchMethodFoundError
.我使用的是 Jenkins 2.85.
I am using JSON function in my Jenkins pipeline and getting NoSuchMethodFoundError
. I am using Jenkins 2.85.
知道如何解决这个问题吗?
Any idea how to resolve this issue?
java.lang.NoSuchMethodError: No such DSL method 'readJSON' found among steps
[archive, bat, build, catchError, checkout, deleteDir, dir,
dockerFingerprintFrom, dockerFingerprintRun, echo, emailext,
emailextrecipients, envVarsForTool, error, fileExists, getContext, git,
input, isUnix, library, libraryResource, load, mail, milestone, node,
parallel, powershell, properties, pwd, readFile, readTrusted, resolveScm,
retry, script, sh, sleep, stage, stash, step, svn, timeout, timestamps, tm,
tool, unarchive, unstash, validateDeclarativePipeline, waitUntil,
withContext, withCredentials, withDockerContainer, withDockerRegistry,
withDockerServer, withEnv, wrap, writeFile, ws] or symbols [all, allOf,
always, ant, antFromApache, antOutcome, antTarget, any, anyOf, apiToken,
architecture, archiveArtifacts, artifactManager, authorizationMatrix,
batchFile, booleanParam, branch, buildButton, buildDiscarder,
caseInsensitive, caseSensitive, certificate, changelog, changeset, choice,
choiceParam, cleanWs, clock, cloud, command, credentials, cron, crumb,
defaultView, demand, disableConcurrentBuilds, docker, dockerCert,
dockerfile, downloadSettings, downstream, dumb, envVars, environment,
expression, file, fileParam, filePath, fingerprint, frameOptions, freeStyle,
freeStyleJob, fromScm, fromSource, git, github, githubPush, gradle,
headRegexFilter, headWildcardFilter, hyperlink, hyperlinkToModels,
inheriting, inheritingGlobal, installSource, jdk, jdkInstaller, jgit,
jgitapache, jnlp, jobName, junit, label, lastDuration, lastFailure,
lastGrantedAuthorities, lastStable, lastSuccess, legacy, legacySCM, list,
local, location, logRotator, loggedInUsersCanDoAnything, masterBuild, maven,
maven3Mojos, mavenErrors, mavenMojos, mavenWarnings, modernSCM, myView,
node, nodeProperties, nonInheriting,
推荐答案
使用 Pipeline Utility Steps Plugin 您可以使用 readJSON
函数.
Using Pipeline Utility Steps Plugin you can use the readJSON
function.
def props = readJSON text: '{ "key": "value" }'
没有这个插件你不能使用这个功能.
You can not use this function without this plugin.
欲了解更多信息,请查看:步骤一个>
For more info check: Steps
这篇关于java.lang.NoSuchMethodError: 没有这样的 DSL 方法“readJSON"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文