>
> Hi,
>
well, the Jenkinsfile for use with declarative pipeline and a 
Jenkinsfile.scripted for scripted pipeline are in the repository ... i 
probably should have mentioned this.
I had a look at the issue - doesn't really fit as in this case i'm not 
using a multibranch pipeline.

Scripted:

#!groovy

stage 'Checkout'
node {
  wrap([$class: 'TimestamperBuildWrapper']) {
    checkout([$class: 'GitSCM', branches: [[name: 'findbugs']], 
doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], 
userRemoteConfigs: [[url: 
'https://github.com/selste/simple-maven-project-with-tests']]])
  }
}

stage 'Build'
node {
  wrap([$class: 'TimestamperBuildWrapper']) {
    withMaven(jdk: 'openjdk 1.8.0', maven: 'maven 3.5.0') {
      sh 'mvn clean compile'
    }
  }
}

stage 'Test'
node {
  wrap([$class: 'TimestamperBuildWrapper']) {
    withMaven(jdk: 'openjdk 1.8.0', maven: 'maven 3.5.0') {
      sh 'mvn test'

      findbugs canComputeNew: false, defaultEncoding: '', excludePattern: '', 
healthy: '', includePattern: '', pattern: '**/target/findbugsXml.xml', 
unHealthy: ''
    }
  }
}



Declarative:

pipeline {
  agent any

  tools {
    maven 'maven 3.5.0'
    jdk 'openjdk 1.8.0'
  }

  stages {
    stage('Checkout') {
      steps {
        checkout([$class: 'GitSCM', branches: [[name: 'findbugs']], 
userRemoteConfigs: [[url: 
'https://github.com/selste/simple-maven-project-with-tests']]])
      }
    }

    stage('Build') {
      steps {
        bat 'mvn clean compile'
      }
    }

    stage('Test') {
      steps {
        bat 'mvn test'
        findbugs canComputeNew: false, defaultEncoding: '', excludePattern: '', 
healthy: '', includePattern: '', pattern: '**/target/findbugsXml.xml', 
unHealthy: ''
      }
    }
  } 

}


I did some tests with more or less the same maven project using multibranch 
pipeline - and got the same results: scripted pipeline leads to duplicate 
findbugs graphs plus the test results graph (not configured), declarative 
pipeline works as expected.
Regards,

S. Elste

-- 
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/f9ec0e12-ca43-442d-94f3-8f3715de7ec2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to