• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • warnings-plugin
    • None
    • Jenkins 2.60.3 and GitSCM

      I use Jenkinsfile and Warnings displayed only result for Maven. The Javac and Javadoc was never displayed.

       

      I want to make it displayed but I have no idea why it is not and what I am doing wrong.

      These are errors in log and I guess it has to do with root cause:

       
      [Pipeline] stage[Pipeline] { (warnings)[Pipeline] warnings[WARNINGS] Parsing warnings in console log with parser Maven
      Skipping warnings blame since pipelines do not have an SCM link.%n
      [WARNINGS] Computing warning deltas based on reference build #136[Pipeline] warnings[WARNINGS] Parsing warnings in console log with parser Java Compiler (javac)
      Skipping warnings blame since pipelines do not have an SCM link.%n
      [WARNINGS] Computing warning deltas based on reference build #136[Pipeline] warnings[WARNINGS] Parsing warnings in console log with parser JavaDoc Tool
      Skipping warnings blame since pipelines do not have an SCM link.%n
      [WARNINGS] Computing warning deltas based on reference build #136[Pipeline] }[Pipeline] // stage[Pipeline] }
      This is my code located in one node only.

       

      stage('warnings') {
      // Install plugin: https://wiki.jenkins.io/display/JENKINS/Warnings+Plugin // https://github.com/jenkinsci/analysis-core-plugin/blob/master/src/main/java/hudson/plugins/analysis/core/HealthAwarePublisher.java // https://github.com/jenkinsci/warnings-plugin/blob/master/src/main/java/hudson/plugins/warnings/WarningsPublisher.java //https://wiki.jenkins.io/display/JENKINS/Static+Code+Analysis+Plug-ins step([$class: 'WarningsPublisher',
      consoleParsers: [
      [parserName: 'Maven']
      ],
      canComputeNew: true,
      canResolveRelativePaths: true,
      canRunOnFailed: true,
      categoriesPattern: '',
      defaultEncoding: '',
      excludePattern: '',
      healthy: '100',
      includePattern: '',
      messagesPattern: '',
      unHealthy: '10000'])

      step([$class: 'WarningsPublisher',
      consoleParsers: [
      [parserName: 'Java Compiler (javac)'],
      ],
      canComputeNew: true,
      canResolveRelativePaths: true,
      canRunOnFailed: true,
      categoriesPattern: '',
      defaultEncoding: '',
      excludePattern: '',
      healthy: '1000',
      includePattern: '',
      messagesPattern: '',
      unHealthy: '100000'])

      step([$class: 'WarningsPublisher',
      consoleParsers: [
      [parserName: 'JavaDoc Tool']
      ],
      canComputeNew: true,
      canResolveRelativePaths: true,
      canRunOnFailed: true,
      categoriesPattern: '',
      defaultEncoding: '',
      excludePattern: '',
      healthy: '1000',
      includePattern: '',
      messagesPattern: '',
      unHealthy: '100000'])
      }

       

          [JENKINS-46761] WarningsPublisher skipped due to SCM link

          Ulli Hafner added a comment -

          It is not yet possible to use 3 calls, you need to create a single step.

          Please also comment your requirements in the corresponding wiki page.

          Ulli Hafner added a comment - It is not yet possible to use 3 calls, you need to create a single step. Please also comment your requirements in the corresponding wiki page .

          Tibor Digana added a comment - - edited

          drulli

          So the only possible is this [1] ? I have Groovy Jenkinsfile and not the descriptive language. So calling publishWarnings in stage three times instead of {{step $class}} is the trick? It's a bit complicated for me to transform my code in new functions.

          On Wiki I see static analysis only. Can you please give me example how to transform all my parameters I have in Maven Warnings to the calls with your functions?

          [1]:

           

          stage ('Warnings Maven') {

          step([$class: 'WarningsPublisher', ...])

          }

          stage ('Warnings Javac') {

          step([$class: 'WarningsPublisher', ...])

          }

          stage ('Warnings Javadoc') {

          step([$class: 'WarningsPublisher', ...])

          }

           

           

          Tibor Digana added a comment - - edited drulli So the only possible is this [1] ? I have Groovy Jenkinsfile and not the descriptive language. So calling publishWarnings in stage three times instead of {{ step $class }} is the trick? It's a bit complicated for me to transform my code in new functions. On Wiki I see static analysis only. Can you please give me example how to transform all my parameters I have in Maven Warnings to the calls with your functions? [1] :   stage ('Warnings Maven') { step( [$class: 'WarningsPublisher', ...] ) } stage ('Warnings Javac') { step( [$class: 'WarningsPublisher', ...] ) } stage ('Warnings Javadoc') { step( [$class: 'WarningsPublisher', ...] ) }    

          Tibor Digana added a comment - - edited

          In Wiki I see the use of function {{publishWarnings()}} but i for instance do not understand the order of parameters and their type. Where can I find signature documented? I see your Java code on GitHub https://github.com/jenkinsci/warnings-plugin/blob/master/src/main/java/hudson/plugins/warnings/WarningsPublisher.java. The function call and parameters should be called like this in my case?

          publishWarnings(consoleParsers: [
          [parserName: 'JavaDoc Tool']
          ],
          canComputeNew: true,
          canResolveRelativePaths: true,
          canRunOnFailed: true,
          categoriesPattern: '',
          defaultEncoding: '',
          excludePattern: '',
          healthy: '1000',
          includePattern: '',
          messagesPattern: '',
          unHealthy: '100000')

           

          How the signature publishWarnings(pmdDelta, "/pmdResults") matches with the class WarningsPublisher.java on GitHub?

           

           

           

          Tibor Digana added a comment - - edited In Wiki I see the use of function {{ publishWarnings() }} but i for instance do not understand the order of parameters and their type. Where can I find signature documented? I see your Java code on GitHub https://github.com/jenkinsci/warnings-plugin/blob/master/src/main/java/hudson/plugins/warnings/WarningsPublisher.java . The function call and parameters should be called like this in my case? publishWarnings ( consoleParsers : [ [ parserName : 'JavaDoc Tool' ] ], canComputeNew : true , canResolveRelativePaths : true , canRunOnFailed : true , categoriesPattern : '' , defaultEncoding : '' , excludePattern : '' , healthy : '1000' , includePattern : '' , messagesPattern : '' , unHealthy : '100000')   How the signature publishWarnings(pmdDelta, "/pmdResults" ) matches with the class WarningsPublisher.java on GitHub?      

          Ulli Hafner added a comment - - edited

          No, with the current release you need to pass 3 parsers to one step:

          step([$class: 'WarningsPublisher', consoleParsers: [
                   [parserName: 'Java Compiler (javac)'],
                   [parserName: 'JavaDoc Tool']
                   [parserName: 'Java Compiler (javac)']
          ])
          

          or shorter

          warnings consoleParsers: [  
               [parserName: 'Java Compiler (javac)'],
               [parserName: 'JavaDoc Tool']
               [parserName: 'Java Compiler (javac)'],
          ]
          

          Ulli Hafner added a comment - - edited No, with the current release you need to pass 3 parsers to one step: step([$class: 'WarningsPublisher', consoleParsers: [ [parserName: 'Java Compiler (javac)'], [parserName: 'JavaDoc Tool'] [parserName: 'Java Compiler (javac)'] ]) or shorter warnings consoleParsers: [ [parserName: 'Java Compiler (javac)'], [parserName: 'JavaDoc Tool'] [parserName: 'Java Compiler (javac)'], ]

          Ulli Hafner added a comment -

          The Wiki page describes the new requirements, this is a mockup. There is no implementation yet.

          Ulli Hafner added a comment - The Wiki page describes the new requirements, this is a mockup. There is no implementation yet.

          Tibor Digana added a comment -

          Sorry we were concurrently posting the comments.

          Now it is clearer.

          The code described looks interesting on Wiki because it's related to PMD, Findbugs as well, so it would be nice to try in the future.

           

          Thx for help, I think we can close this issue now.

          Tibor Digana added a comment - Sorry we were concurrently posting the comments. Now it is clearer. The code described looks interesting on Wiki because it's related to PMD, Findbugs as well, so it would be nice to try in the future.   Thx for help, I think we can close this issue now.

            drulli Ulli Hafner
            tibor17 Tibor Digana
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: