Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72518

Include/Exclude pattern in Open Task Scanner does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • warnings-ng-plugin
    • None

      Consider such pipeline:

      pipeline {
        agent any
        stages {
          stage('Build distribution package') {
            steps {
              discoverGitReferenceBuild()
              mineRepository()
              withMaven() {
                sh "$MVN_CMD clean package"
              }
            }
          }
        }
        post {
          always {
            recordIssues(tools: [
              taskScanner(highTags: '@Deprecated', normalTags:'FIXME', lowTags:'TODO', includePattern: '**/*.java, **/*.properties, **/*.xml', excludePattern: 'target/**/*')
            ])
          }
        }
      }

      Now consider such project structure:

      /src/main/java/Project.java
      /src/main/resources/project.properties
      /src/main/resources/log4j2.xml
      /pom.xml 
      

       

      When a project is built with Maven the folder structure becomes:

      /src/main/java/Project.java
      /src/main/resources/project.properties
      /src/main/resources/log4j2.xml
      /pom.xml
      /target/classes/Project.class
      /target/classes/log4j2.xml
      

       

      Now if such workspace is mined for forensics and then scanned with Open Tasks Scanner it produces such error:

      17:26:15 [Open Tasks Scanner] [-ERROR-] Errors while obtaining repository statistics
      17:26:15 [Open Tasks Scanner] [-ERROR-] No statistics found for file 'workspace-name/target/classes/log4j2.xml'
      

      If I remove forensics plugin from the workflow the error disappears.

       

      From the looks of it Open Tasks Scanner doesn't apply exclude rules (in this case exclude for XML file) correctly when combined with forensics plugin. Or maybe forensics plugin just takes includes but doesn't take excludes?

            drulli Ulli Hafner
            vilius Vilius
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: