| Issue: Prior to recently updating a few Jenkins Plugins, we were successfully using the Warnings Next Gen Plug in, and following those plugin updates, the build fails and we are shown the referenced Error Message...which seems to be a net result of changes to the "tools" related to Static Analysis. Legacy plugins which note that the functions have been removed / moved to Warnings Next Gen were previously uninstalled. Error = java.lang.NoSuchMethodError: No such DSL method 'spotBugs Additional Info
- ** There is a publisher listed below for spot bugs, but it does not match the Warnings Next Gen docs of "spotBugs", the value / method referenced below is, which represents an unexpected change"spotBugsPublisher"
- Also noted that there are no publishers available for PMD, CPD or Checkstyle any longer
DSL Entry, which previously worked
steps {
// Compile / Static Analysis
warnError('Static Analysis has FAILED') {
sh "mvn install -e -U -DskipTests -Pstatic-analysis -Padobe-public"
}
archiveArtifacts artifacts: ('**/target/checkstyle-result.xml')
archiveArtifacts artifacts: ('**/target/spotbugsXml.xml')
archiveArtifacts artifacts: ('**/target/pmd.xml')
archiveArtifacts artifacts: ('**/target/cpd.xml')
archiveArtifacts artifacts: ('**/target/site/jacoco/jacoco.xml')
//Sonarqube analysis
warnError('Sonarqube Analysis has FAILED') {
sh "mvn sonar:sonar -Dsonar.branch.name=${env.BRANCH_NAME}"
}
//Script protocol is needed here, otherwise Pipeline will throw an error
//TODO Remediate post build publish issue, as it would not be anticipated that the script variable would be needed here - https://github.com/jenkinsci/job-dsl-plugin/wiki/Script-Security
script {
checkstyle = scanForIssues tool: checkStyle(pattern: '**/target/checkstyle-result.xml')
publishIssues issues: [checkstyle]
pmd = scanForIssues tool: pmdParser(pattern: '**/target/pmd.xml')
publishIssues issues: [pmd]
cpd = scanForIssues tool: cpd(pattern: '**/target/cpd.xml')
publishIssues issues: [cpd]
spotbugs = scanForIssues tool: spotBugs(pattern: '**/target/spotbugsXml.xml')
publishIssues issues: [spotbugs]
maven = scanForIssues tool: mavenConsole()
publishIssues issues: [maven]
}
}
}
Console Error for Spotbugs...but similar appeared for checkStyle, pmdParser and cpd java.lang.NoSuchMethodError: No such DSL method 'spotBugs' found among steps [ansiColor, archive, bat, bbs_checkout, build, catchError, checkout, createDeploymentEvent, createDynatraceDeploymentEvent, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, findFiles, getContext, git, input, isUnix, jiraAddComment, jiraAddWatcher, jiraAssignIssue, jiraAssignableUserSearch, jiraComment, jiraDeleteAttachment, jiraDeleteIssueLink, jiraDeleteIssueRemoteLink, jiraDeleteIssueRemoteLinks, jiraDownloadAttachment, jiraEditComment, jiraEditComponent, jiraEditIssue, jiraEditVersion, jiraGetAttachmentInfo, jiraGetComment, jiraGetComments, jiraGetComponent, jiraGetComponentIssueCount, jiraGetFields, jiraGetIssue, jiraGetIssueLink, jiraGetIssueLinkTypes, jiraGetIssueRemoteLink, jiraGetIssueRemoteLinks, jiraGetIssueTransitions, jiraGetIssueWatches, jiraGetProject, jiraGetProjectComponents, jiraGetProjectStatuses, jiraGetProjectVersions, jiraGetProjects, jiraGetServerInfo, jiraGetVersion, jiraIssueSelector, jiraJqlSearch, jiraLinkIssues, jiraNewComponent, jiraNewIssue, jiraNewIssueRemoteLink, jiraNewIssues, jiraNewVersion, jiraNotifyIssue, jiraSearch, jiraTransitionIssue, jiraUploadAttachment, jiraUserSearch, junit, library, libraryResource, load, lock, mail, milestone, nexusArtifactUploader, nexusPolicyEvaluation, nexusPublisher, node, nodesByLabel, parallel, perfSigDynatraceReports, powershell, properties, publishHTML, pwd, pwsh, readCSV, readFile, readJSON, readManifest, readMavenPom, readProperties, readTrusted, readYaml, recordDynatraceCustomSession, recordDynatraceSession, resolveScm, retry, script, selectRun, sendSplunkConsoleLog, sendSplunkFile, setGerritReview, sh, sha1, slackSend, slackUploadFile, sleep, sshagent, stage, stash, step, svn, tee, timeout, timestamps, tm, tool, touch, unarchive, unstable, unstash, unzip, validateDeclarativePipeline, waitForQualityGate, waitUntil, warnError, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, withMaven, withNPM, wrap, writeCSV, writeFile, writeJSON, writeMavenPom, writeYaml, ws, xunit, zip] or symbols [AUnit, BbS, BitbucketSCMStep, BitbucketWebhookTriggerImpl, BoostTest, CTest, CUnit, Check, CppTest, CppUnit, Custom, FPCUnit, GoogleTest, JUnit, MSTest, MbUnit, NUnit2, NUnit3, PHPUnit, QtTest, UnitTest, Valgrind, absolute, activateDTConfiguration, all, allOf, always, and, ant, antFromApache, antOutcome, antTarget, any, anyOf, apiToken, architecture, archiveArtifacts, artifact, artifactManager, artifactResolver, artifactsPublisher, associateTag, audit-trail, authorizationMatrix, batchFile, bitBucketTrigger, bitbucket, bitbucketBranchDiscovery, bitbucketForkDiscovery, bitbucketPublicRepoPullRequestFilter, bitbucketPullRequestDiscovery, bitbucketPush, bitbucketSshCheckout, bitbucketTagDiscovery, bitbucketTrustEveryone, bitbucketTrustNobody, bitbucketTrustProject, bitbucketTrustTeam, bitbucketWebhookConfiguration, bitbucketWebhookRegistration, bitbucketpr, booleanParam, branch, brokenBuildSuspects, brokenTestsSuspects, buildButton, buildDescription, buildDiscarder, buildFailureAnalyzer, buildName, buildNumber, buildParameter, buildSelector, buildingTag, bzt, caseInsensitive, caseSensitive, certificate, changeAbandoned, changeMerged, changeRequest, changeRestored, changelog, changeset, checkoutToSubdirectory, chlAtuoAction, choice, choiceParam, cleanWs, clock, cloud, command, commentAdded, commentAddedContains, concordionPublisher, configFile, configFileProvider, copyArtifactPermission, copyArtifacts, createMemoryDump, createTag, createThreadDump, credentials, cron, crumb, cucumber, culprits, default, defaultFolderConfiguration, defaultView, deleteComponents, demand, dependenciesFingerprintPublisher, dependency-check, dependencyCheck, dependencyCheckPublisher, dependencyTrackPublisher, dependencycheck, developers, disableConcurrentBuilds, disableResume, displayName, docker, dockerCert, dockerfile, downstream, draftPublished, dumb, durabilityHint, embUnit, envInject, envVars, environment, environmentDashboard, equals, executor, expression, extendedChoice, failed, fallback, file, fileParam, filePath, findbugsPublisher, fingerprint, frameOptions, freeStyle, freeStyleJob, fromScm, fromSource, gerrit, git, gitBranchDiscovery, gitHubBranchDiscovery, gitHubBranchHeadAuthority, gitHubForkDiscovery, gitHubTagDiscovery, gitHubTrustContributors, gitHubTrustEveryone, gitHubTrustNobody, gitHubTrustPermissions, gitParameter, gitTagDiscovery, github, githubAccessToken, githubPush, globalConfigFiles, gtester, headRegexFilter, headWildcardFilter, http, hyperlink, hyperlinkToModels, inheriting, inheritingGlobal, installSource, invokerPublisher, isRestartedRun, jacoco, jacocoPublisher, jdk, jdkInstaller, jgit, jgitapache, jgivenPublisher, jnlp, jobDsl, jobName, junitPublisher, label, lastCompleted, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, lastSuccessful, lastWithArtifacts, latestSavedBuild, legacy, legacySCM, list, local, location, logParser, logRotator, loggedInUsersCanDoAnything, manualApplication, masterBuild, maven, maven3Mojos, mavenErrors, mavenLinkerPublisher, mavenMojos, mavenWarnings, modernSCM, moveComponents, myView, newContainerPerStage, node, nodeProperties, nodejs, nodejsci, nonInheriting, none, not, notifyBitbucket, notifyStash, openTasksPublisher, or, overrideIndexTriggers, paneStatus, parallelsAlwaysFailFast, parameterized, parameters, passed, password, patchsetCreated, pattern, perfReport, perfSigReports, performanceReport, performanceTest, perfpublisher, permalink, permanent, pipeline-model, pipeline-model-docker, pipelineGraphPublisher, pipelineMaven, pipelineTriggers, plainText, plugin, pollSCM, preserveStashes, previous, privateStateChanged, projectKeyRegexFilter, projectNameRegexFilter, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, rateLimitBuilds, recipients, refUpdated, relative, requestor, resourceRoot, rule, run, runParam, s3CopyArtifact, s3Upload, sSHLauncher, saved, schedule, scmRetryCount, script, scriptApproval, scriptApprovalLink, search, security, selectedApplication, shell, skipDefaultCheckout, skipStagesAfterUnstable, skipped, slackNotifier, slave, snapshotDependencies, sourceRegexFilter, sourceWildcardFilter, specific, splunkinsJobOption, spotbugsPublisher, ssh, sshUserPrivateKey, stackTrace, standard, startSession, status, stopSession, string, stringParam, swapSpace, tag, testCase, text, textParam, timezone, tmpSpace, toolLocation, topicChanged, triggeredBy, triggering, unsecured, upstream, upstreamDevelopers, url, userSeed, usernameColonPassword, usernamePassword, veracode, veracodeDynamicRescan, viewsTabBar, weather, wipStateChanged, withAnt, withSonarQubeEnv, workspace, xUnitDotNet, zfs, zip] or globals [currentBuild, docker, env, fileLoader, params, pipeline, scm, splunkins] |