Thanks @ulli for your reply. *'Did you install the 5.0 beta version of the plugin? This step is not available in the 4.x version.*' Ahh... :) No. Where do I get that from and how to install in Jenkins?
On Sat, Oct 27, 2018 at 6:07 PM Ulli Hafner <[email protected]> wrote: > > > Von meinem iPad gesendet > > Am 26.10.2018 um 09:50 schrieb dean warren <[email protected]>: > > I am trying to get the Warnings plugin collecting CheckStyle results > within a pipeline. > > I believe I am using all the latest versions of pipeline related modules, > and the warnings modules. > > > > A simplified version of my Jenkinsfile is something like: > > timestamps { > node ('name') { > try > { > stage ('Checkout') { > checkout scm > } > stage ('Build & Test') { > sh 'bash -x test.sh' > } > stage ('CheckStyle') { > sh 'java -jar > /home/user/checkstyle/checkstyle-6.5-all.jar -c /home/user/checkstyle.xml > -f xml -c target/checkstyle-results.xml src' > // Doesn't work > // step([$class: 'CheckStylePublisher', > // canRunOnFailed: true, > // defaultEncoding: '', > // healthy: '100', > // pattern: '**/target/checkstyle-result.xml', > // unHealthy: '90', > // useStableBuildAsReference: true > // ]) > > > This publisher requires the CheckStyle plugin. > > // Doesn't work > // step([$class: 'WarningsPublisher', consoleParsers: > [[parserName: 'CheckStyle']]]) > > > > The warnings publisher from the 4.x version does not support CheckStyle > yet. > > > // Doesn't work > def checkstyle = scanForIssues tool: [$class: > 'CheckStyle'], pattern: '**/target/checkstyle-result.xml' > publishIssues issues:[checkstyle] > } > } > catch (caughtErr) > { > } > finally > { > } > } > } > > > Did you install the 5.0 beta version of the plugin? This step is not > available in the 4.x version. > > Where I have tried three different methods to collect the checkstype > results, none of which work (I have left two of them commented out for > reference - but beleive these are methods for the legacy checkstyle plugin, > not the newly integrated warnigns plugin?). > > > I believe the last method using scanForIssues is the correct method as per > here: > > https://github.com/jenkinsci/warnings-plugin/blob/master/Jenkinsfile.local > > > > However on build, I see the checkstyle results being generated, but get > the following error message > java.lang.NoSuchMethodError: No such DSL method 'scanForIssues' found > among steps > > Any ideas? > Thanks in advance! > > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/00750112-2e37-4213-91b3-01c87686433c%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/00750112-2e37-4213-91b3-01c87686433c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/71651BEB-5A46-4E4C-B8E5-C8C688B3D162%40gmail.com > <https://groups.google.com/d/msgid/jenkinsci-users/71651BEB-5A46-4E4C-B8E5-C8C688B3D162%40gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAKYjVYyXG_JszLpW0mKo%2B4iAKEj76g-wHWejAbxQyE_rUUZwHg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
