简体   繁体   English

java.lang.NoSuchMethodError:步骤之间未找到这种DSL方法

[英]java.lang.NoSuchMethodError: No such DSL method found among steps

I'm trying to remove the warning, Using the 'stage' step without a block argument is deprecated . 我正在尝试删除警告,不建议Using the 'stage' step without a block argument is deprecated So, I'm doing is adding block for stage 所以,我正在做的是添加阶段的块

stage 'Install Tool' {
    // code
}

Now, jenkins gives the error 现在,詹金斯给出了错误

    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)

Is adding block the right thing to do? 添加块是正确的做法吗?

The correct Groovy syntax would be: 正确的Groovy语法为:

stage('Install Tool') {
    // code
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.NoSuchMethodError:在步骤中找不到这样的DSL方法'echo' - java.lang.NoSuchMethodError: No such DSL method 'echo' found among steps 詹金斯:java.lang.NoSuchMethodError:在步骤中找不到这样的DSL方法'$' - Jenkins : java.lang.NoSuchMethodError: No such DSL method '$' found among steps java.lang.NoSuchMethodError:在步骤中找不到这样的DSL方法'bash' - java.lang.NoSuchMethodError: No such DSL method 'bash' found among steps java.lang.NoSuchMethodError:在步骤中找不到这样的 DSL 方法“sshagent”? - java.lang.NoSuchMethodError: No such DSL method 'sshagent' found among steps? 错误java.lang.NoSuchMethodError:在步骤之间找不到这样的DSL方法“ ***” - Error java.lang.NoSuchMethodError: No such DSL method '***' found among steps java.lang.NoSuchMethodError: 在步骤中找不到这样的 DSL 方法“$” - java.lang.NoSuchMethodError: No such DSL method '$' found among steps java.lang.NoSuchMethodError: 在使用 jenkins 共享库时,在步骤中找不到这样的 DSL 方法“ci” - java.lang.NoSuchMethodError: No such DSL method 'ci' found among steps when using jenkins shared library java.lang.NoSuchMethodError: 在步骤 [approveReceivedEvent, - java.lang.NoSuchMethodError: No such DSL method 'withKubeConfig' found among steps [approveReceivedEvent, Jenkinsfile 错误 - java.lang.NoSuchMethodError: 在步骤中找不到这样的 DSL 方法“withMaven” - Jenkinsfile error- java.lang.NoSuchMethodError: No such DSL method 'withMaven' found among steps java.lang.NoSuchMethodError:在步骤之间找不到这样的DSL方法“ pollScm”(Jenkins脚本化管道) - java.lang.NoSuchMethodError: No such DSL method 'pollScm' found among steps (Jenkins scripted pipeline)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM