Jenkins 没有usernamePassword方法

构建报错:

java.lang.NoSuchMethodError: No such DSL method 'usernamePassword' found among steps [acceptGitLabMR, addGitLabMRComment, archive, bat, catchError, checkout, deleteDir, dir, echo, emailext, emailextrecipients, error, fileExists, findBuildScans, getContext, git, gitlabBuilds, gitlabCommitStatus, httpRequest, isUnix, jiraComment, jiraIssueSelector, jiraSearch, junit, library, libraryResource, load, mail, nexusPolicyEvaluation, nexusPublisher, node, parallel, powershell, properties, publishHTML, pwd, pwsh, readFile, readTrusted, resolveScm, retry, sh, sleep, sshCommand, sshGet, sshPut, sshRemove, sshScript, stage, stash, step, svn, timeout, timestamps, tm, tool, unarchive, unstable, unstash, updateGitlabCommitStatus, waitUntil, warnError, withContext, withEnv, withGradle, wrap, writeFile, ws] or symbols [all, always, ant, antFromApache, antOutcome, antTarget, apiToken, architecture, archiveArtifacts, artifactManager, associateTag, authorizationMatrix, batchFile, bitbucket, bitbucketBranchDiscovery, bitbucketForkDiscovery, bitbucketPublicRepoPullRequestFilter, bitbucketPullRequestDiscovery, bitbucketSshCheckout, bitbucketTagDiscovery, bitbucketTrustEveryone, bitbucketTrustNobody, bitbucketTrustProject, bitbucketTrustTeam, bitbucketWebhookConfiguration, bitbucketWebhookRegistration, booleanParam, brokenBuildSuspects, brokenTestsSuspects, buildButton, buildDiscarder, caseInsensitive, caseSensitive, choice, choiceParam, cleanWs, clock, cloud, command, configFile, configFileProvider, createTag, credentials, cron, crumb, culprits, default, defaultFolderConfiguration, defaultView, deleteComponents, demand, developers, disableConcurrentBuilds, disableResume, downloadSettings, downstream, dumb, durabilityHint, envVars, executor, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, freeStyleJob, fromScm, fromSource, git, gitBranchDiscovery, gitHubBranchDiscovery, gitHubBranchHeadAuthority, gitHubExcludeArchivedRepositories, gitHubForkDiscovery, gitHubPullRequestDiscovery, gitHubSshCheckout, gitHubTagDiscovery, gitHubTrustContributors, gitHubTrustEveryone, gitHubTrustNobody, gitHubTrustPermissions, gitLabConnection, gitParameter, gitTagDiscovery, github, githubPush, gitlab, globalConfigFiles, gradle, headRegexFilter, headWildcardFilter, hyperlink, hyperlinkToModels, inheriting, inheritingGlobal, installSource, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobName, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, legacySCM, list, local, location, logRotator, loggedInUsersCanDoAnything, mailer, manualApplication, masterBuild, maven, maven3Mojos, mavenErrors, mavenMojos, mavenWarnings, modernSCM, moveComponents, msbuild, msbuildError, msbuildWarning, myView, nodeProperties, nodejs, nodejsci, nonInheriting, none, overrideIndexTriggers, paneStatus, parameters, password, pattern, permanent, pipelineTriggers, plainText, plugin, pollSCM, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, rateLimitBuilds, recipients, requestor, run, runParam, sSHLauncher, schedule, scmRetryCount, scriptApproval, scriptApprovalLink, search, security, selectedApplication, shell, slave, sourceRegexFilter, sourceWildcardFilter, ssh, stackTrace, standard, status, string, stringParam, swapSpace, teamSlugFilter, text, textParam, tmpSpace, toolLocation, unsecured, upstream, upstreamDevelopers, 

解决方法:安装credentials-binding插件

注:别忘了重启Jenkins

猜你喜欢

转载自blog.csdn.net/qq_41983562/article/details/106645227