我正在尝试删除警告,不推荐使用没有块参数的“阶段”步骤
。所以,我正在为阶段添加块
stage 'Install Tool' {
// code
}
现在,詹金斯给出了错误
java.lang.NoSuchMethodError: No such DSL method 'Install Tool' found among steps [archive, bat, build, catchError, checkout, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, findFiles, getContext, git, httpRequest, input, isUnix, library, libraryResource, load, mail, milestone, node, parallel, properties, pwd, readFile, readJSON, readManifest, readMavenPom, readProperties, readTrusted, readYaml, resolveScm, retry, script, sh, slackSend, sleep, stage, stash, step, svn, timeout, timestamps, tool, touch, unarchive, unstash, unzip, validateDeclarativePipeline, waitUntil, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, wrap, writeFile, writeJSON, writeMavenPom, ws, zip] or symbols [all, allOf, always, ant, antFromApache, antOutcome, antTarget, any, anyOf, apiToken, architecture, archiveArtifacts, artifactManager, batchFile, booleanParam, branch, buildButton, buildDiscarder, caseInsensitive, caseSensitive, choice, choiceParam, clock, cloud, command, cron, crumb, defaultView, demand, disableConcurrentBuilds, docker, dockerfile, downloadSettings, downstream, dumb, envVars, environment, expression, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, freeStyleJob, git, github, githubPush, gradle, hyperlink, hyperlinkToModels, 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, nonStoredPasswordParam, none, not, overrideIndexTriggers, paneStatus, parameters, password, pattern, pipeline-model, pipelineTriggers, plainText, plugin, pollSCM, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, run, runParam, schedule, scmRetryCount, search, security, shell, skipDefaultCheckout, skipStagesAfterUnstable, slave, stackTrace, standard, status, string, stringParam, swapSpace, text, textParam, tmpSpace, toolLocation, unsecured, upstream, usernameColonPassword, usernamePassword, viewsTabBar, weather, zfs, zip] or globals [currentBuild, docker, env, params, pipeline, scm]
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:149)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
at groovy.lang.GroovyObject$invokeMethod$30.call(Unknown Source)
添加块是正确的做法吗?
正确的Groovy语法应该是:
stage('Install Tool') {
// code
}
我有以下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上实现一个阶段,以在jenkins发生故障时发送电子邮件。我做了一些类似于詹金斯记录的东西: 但是我总是得到这个错误: java.lang.NoSuchMethodError:在步骤[archive,bat,build,catchError,checkout,deleteDir,dir,dockerFingerprintFrom,dockerFingerpri
我目前正在尝试使用jenkinsfile在jenkins中实现管道,我正在windows机器上执行一个maven项目。我正在jenkins中创建一个管道作业,我已经在我的github存储库中签入了这个文件,当我在jenkins中运行作业时,我收到了以下错误。 我的jenkinsfile: 我得到下面的错误,当我运行它通过詹金斯工作-Jenkins错误: java.lang.NoSuchMethod
我正试图读取詹金斯管道中的一个文件。 为此,我在我的jenkins文件中导入的库中定义了下面的函数。 但是,我一直得到以下例外。 此外,如果我删除< code>readFile函数调用,我的jenkins管道将成功执行。 你知道这里有什么问题吗?
我已经安装了所有的管道插件, 但我仍在得到 我漏了什么插件吗?