Added new local Jenkinsfile.
@@ -4,39 +4,30 @@ node {
}
stage ('Build') {
- def mvnHome = tool 'mvn-default'
+ def mvnHome = tool 'mvn-3.6.0'
- sh "${mvnHome}/bin/mvn --batch-mode -V -U -e clean verify -Dsurefire.useFile=false -Dmaven.test.failure.ignore"
+ sh "${mvnHome}/bin/mvn --batch-mode -V -U -e clean verify -DskipTests"
- junit testResults: '**/target/surefire-reports/TEST-*.xml'
-
- def java = scanForIssues tool: [$class: 'Java']
- def javadoc = scanForIssues tool: [$class: 'JavaDoc']
-
- publishIssues issues:[java,javadoc], unstableTotalAll:1
+ recordIssues tools: [java(), javaDoc()], aggregatingResults: 'true', id: 'java', name: 'Java'
+ recordIssues tool: errorProne()
}
stage ('Analysis') {
- def mvnHome = tool 'mvn-default'
-
- sh "${mvnHome}/bin/mvn -batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd findbugs:findbugs spotbugs:spotbugs"
+ def mvnHome = tool 'mvn-3.6.0'
- def checkstyle = scanForIssues tool: [$class: 'CheckStyle'], pattern: '**/target/checkstyle-result.xml'
- publishIssues issues:[checkstyle], unstableTotalAll:1
+ sh "${mvnHome}/bin/mvn --batch-mode -V -U -e verify"
- def pmd = scanForIssues tool: [$class: 'Pmd'], pattern: '**/target/pmd.xml'
- publishIssues issues:[pmd], unstableTotalAll:1
-
- def cpd = scanForIssues tool: [$class: 'Cpd'], pattern: '**/target/cpd.xml'
- publishIssues issues:[cpd]
-
- def findbugs = scanForIssues tool: [$class: 'FindBugs'], pattern: '**/target/findbugsXml.xml'
- publishIssues issues:[findbugs], unstableTotalAll:1
+ recordIssues tools: [checkStyle(),
+ spotBugs(pattern: 'target/spotbugsXml.xml'),
+ pmdParser(pattern: 'target/pmd.xml'),
+ cpd(pattern: 'target/cpd.xml'),
+ taskScanner(highTags:'FIXME', normalTags:'TODO', includePattern: '**/*.java', excludePattern: 'target/**/*')]
+ }
- def spotbugs = scanForIssues tool: [$class: 'SpotBugs'], pattern: '**/target/spotbugsXml.xml'
- publishIssues issues:[spotbugs], unstableTotalAll:1
+ stage ('Coverage') {
+ def mvnHome = tool 'mvn-3.6.0'
- def maven = scanForIssues tool: [$class: 'MavenConsole']
- publishIssues issues:[maven]
+ sh "${mvnHome}/bin/mvn --batch-mode -V -U -e jacoco:prepare-agent test jacoco:report -Djenkins.test.timeout=240"
+ publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')]
}
}
\ No newline at end of file
