[JIRA] (JENKINS-61058) Checkstyle, PMD and CPD publishers missing after plugin updates

11 views
Skip to first unread message

jaydubb12@gmail.com (JIRA)

unread,
Feb 11, 2020, 10:19:03 AM2/11/20
to jenkinsc...@googlegroups.com
Jason Wolf created an issue
 
Jenkins / Bug JENKINS-61058
Checkstyle, PMD and CPD publishers missing after plugin updates
Issue Type: Bug Bug
Assignee: Unassigned
Components: warnings-ng-plugin
Created: 2020-02-11 15:18
Environment: Jenkins 2.2.04.1
Warnings NextGen Plug in 7.3.0
Legacy CheckStyle Plugin = None
Legacy PMD Plugin = None
Priority: Major Major
Reporter: Jason Wolf

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]

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jaydubb12@gmail.com (JIRA)

unread,
Feb 12, 2020, 7:17:03 AM2/12/20
to jenkinsc...@googlegroups.com
Jason Wolf updated an issue
Change By: Jason Wolf
*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 Initial review of the functions have stack trace has been removed challenging, but after weeding through, my assumption is that there is a new conflict with the CPS / moved to Warnings Next Gen were previously uninstalled. Script Security Feature

 

*Error =* java.lang.NoSuchMethodError: No such DSL method 'spotBugs

 

*Additional Info* 
*
The reference to .cps workflow tells me that potentially with the plugin update(s), something is potentially an issue with the Workflow CPS plugin, but regrettably I cant seem to find a way to get the config to work, and I dont want to just  


* *  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
{code:java}

{code}
 

*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]

jaydubb12@gmail.com (JIRA)

unread,
Feb 12, 2020, 3:44:02 PM2/12/20
to jenkinsc...@googlegroups.com
Jason Wolf commented on Bug JENKINS-61058
 
Re: Checkstyle, PMD and CPD publishers missing after plugin updates

Potential docs to update for clarity

<url>/plugin/job-dsl/api-viewer/index.html#

 

 

Interim Resolution

I was able to get this working in my project,  which is a pipeline project, but only by

  • Setting the "recordIssues" configs as their own stage, given there is not option to use "publisher" or "post" within a Pipeline job, given the system will throw an error
stage ('Publish Static Analysis Reports') {
    steps {
        //These settings are called out separately and not included in the preceding stage as it will create a concurrency issue
        recordIssues enabledForFailure: true, tool: checkStyle()
        recordIssues enabledForFailure: true, tool: spotBugs()
        recordIssues enabledForFailure: true, tool: cpd(pattern: '**/target/cpd.xml')
        recordIssues enabledForFailure: true, tool: pmdParser(pattern: '**/target/pmd.xml')       
    }
}

ullrich.hafner@gmail.com (JIRA)

unread,
Feb 13, 2020, 6:17:02 PM2/13/20
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 22, 2020, 12:42:02 PM3/22/20
to jenkinsc...@googlegroups.com
Ulli Hafner resolved as Incomplete
 
Change By: Ulli Hafner
Status: Open Resolved
Resolution: Incomplete
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages