java.lang.NoSuchMethodError: No such DSL method 'scmGit' found among steps [acceptGitLabMR, addGitLabMRComment, archive, bat, build, catchError, checkout, deleteDir, dir, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, findBuildScans, getContext, git, gitPush, gitlabBuilds, gitlabCommitStatus, input, isUnix, junit, library, libraryResource, load, mail, milestone, node, parallel, powershell, properties, publishChecks, publishHTML, pwd, pwsh, readFile, readTrusted, resolveScm, retry, script, sh, sleep, sshagent, stage, stash, step, timeout, timestamps, tm, tool, unarchive, unstable, unstash, updateGitlabCommitStatus, validateDeclarativePipeline, waitUntil, warnError, withChecks, withContext, withCredentials, withEnv, withGradle, wrap, writeFile, ws] or symbols [GitUsernamePassword, all, allBranchesSame, allOf, always, ant, antFromApache, antOutcome, antTarget, any, anyOf, apiToken, architecture, archiveArtifacts, artifactManager, authorizationMatrix, batchFile, bitbucketServer, booleanParam, branch, brokenBuildSuspects, brokenTestsSuspects, buildButton, buildDiscarder, buildDiscarders, buildRetention, buildUser, buildingTag, builtInNode, caseInsensitive, caseSensitive, certificate, changeRequest, changelog, changeset, checkoutToSubdirectory, choice, choiceParam, cleanWs, clock, command, configFile, configFileProvider, contributor, credentials, cron, crumb, culprits, default, defaultFolderConfiguration, defaultView, demand, developers, disableConcurrentBuilds, disableResume, downstream, dumb, durabilityHint, email-ext, envVars, envVarsFilter, environment, equals, executor, expression, extendedEmailPublisher, file, fileParam, filePath, fingerprint, fingerprints, frameOptions, freeStyle, freeStyleJob, fromScm, fromSource, git, gitBranchDiscovery, gitHubBranchDiscovery, gitHubBranchHeadAuthority,
时间: 2023-09-26 13:07:48 浏览: 47
这个错误提示是 Jenkins 找不到名为 `scmGit` 的 pipeline step。有可能是您的 pipeline 脚本中使用了这个不存在的 step,或者是您使用的插件版本不支持这个 step。建议您检查一下您的 pipeline 脚本和插件版本,确保使用的 step 是存在且支持的。如果需要进一步的帮助,请提供详细的错误信息和 pipeline 脚本。
相关问题
ava.lang.NoSuchMethodError: No such DSL method 'gitlabNotify' found among steps
如果你在使用上述脚本时遇到了 `ava.lang.NoSuchMethodError: No such DSL method 'gitlabNotify' found among steps` 错误,那么可能是因为你没有安装 `Gitlab Plugin` 或者你的 `Gitlab Plugin` 版本太旧,不支持 `gitlabNotify` 函数。
可以尝试更新 `Gitlab Plugin` 到最新版本,或者手动安装最新版本的 `Gitlab Plugin`。安装方法如下:
1. 进入 Jenkins 的插件管理页面,在 `可选插件` 标签页中搜索 `Gitlab Plugin`。
2. 选择最新版本,点击右侧的 `直接安装` 按钮。
3. 等待安装完成后,重启 Jenkins。
安装完成后,尝试重新执行流水线,看看是否还会出现 `NoSuchMethodError` 错误。如果还是有问题,可以尝试在 `pipeline` 中加入 `options { reloadable true }`,强制重新加载插件。例如:
```
pipeline {
options {
reloadable true
}
...
}
```
希望这些方法能够帮助你解决问题。
java.lang.NoSuchMethodError: No direct method
java.lang.NoSuchMethodError错误通常有以下几种可能原因和解决方案:
1、有这个类,该类没有这方法:
在该类中增加缺少的方法即可。
2、类冲突、Jar包冲突、Jar包版本冲突:
删除冲突的类或Jar包,并替换冲突的Jar包版本。
3、在A类中修改了方法的返回值类型,但B类中引用了A类并调用了该方法,且没有重新部署B类:
重新打包部署引用到A类的代码。
请根据具体情况进行相应的解决方案。