gpt4 book ai didi

json - java.lang.NoSuchMethodError:没有这样的DSL方法 'readJSON'

转载 作者:行者123 更新时间:2023-12-03 21:20:44 26 4
gpt4 key购买 nike

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。

任何想法如何解决这个问题?
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函数。

def props = readJSON text: '{ "key": "value" }'

没有此插件,您将无法使用此功能。

有关更多信息,请检查: Steps

关于json - java.lang.NoSuchMethodError:没有这样的DSL方法 'readJSON',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46841877/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com