diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 02c109f..8516706 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -20,6 +20,7 @@ pipeline { } } stage('Static Code Analysis') { + when { expression { findFiles(glob: '**/src/main/java/*.java').length > 0 } } steps { withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') { sh "${mvn} compile checkstyle:checkstyle pmd:pmd" @@ -46,6 +47,7 @@ pipeline { } } stage('Test Results') { + when { expression { findFiles(glob: '**/target/surefire-reports/*.xml').length > 0 } } steps { junit '**/target/surefire-reports/*.xml' jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class' @@ -59,6 +61,7 @@ pipeline { } } stage('Archiving') { + when { expression { findFiles(glob: '**/target/*.jar').length > 0 } } steps { archiveArtifacts '**/target/*.jar' }