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,
使用管道实用程序步骤插件可以使用该readJSON
功能。
def props = readJSON text: '{ "key": "value" }'
没有此插件,您将无法使用此功能。
有关更多信息,请检查:步骤
我已经安装了所有的管道插件, 但我仍在得到 我漏了什么插件吗?
我目前正在尝试使用jenkinsfile在jenkins中实现管道,我正在windows机器上执行一个maven项目。我正在jenkins中创建一个管道作业,我已经在我的github存储库中签入了这个文件,当我在jenkins中运行作业时,我收到了以下错误。 我的jenkinsfile: 我得到下面的错误,当我运行它通过詹金斯工作-Jenkins错误: java.lang.NoSuchMethod
我有以下dsl: 这会失败并出现以下错误 我做错了什么?我正在使用 Jenkins2.89.4 作业DSL 1.68 管道作业2.20 管道:API 2.27 管道:基本步骤2.7 管道:构建步骤2.7 管道:声明1.2.9
我正在尝试删除警告,。所以,我正在为阶段添加块 现在,詹金斯给出了错误 添加块是正确的做法吗?
我想运行bash命令抛出Jenkins管道,我正在调用一个具有一些bash命令的函数,但我得到这个错误: 这是函数: defcopy_tools(){ } 你能帮忙吗?
我在Jenkins管道中使用下面的Groovy脚本来调用自由风格的作业,但它最终出现了“没有这样的DSL方法‘构建’”错误。