Repository: maven-surefire Updated Branches: refs/heads/SUREFIRE-1463 09f0eef84 -> d1ae81088
[SUREFIRE-1472] Multibranch Pipeline supports JDK 7-10 Maven 3.2-3.5 Linux Windows Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/d1ae8108 Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/d1ae8108 Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/d1ae8108 Branch: refs/heads/SUREFIRE-1463 Commit: d1ae81088f78738662de8d85b96672e821469697 Parents: 09f0eef Author: Tibor17 <tibordig...@apache.org> Authored: Tue Feb 6 05:30:00 2018 +0100 Committer: Tibor17 <tibordig...@apache.org> Committed: Tue Feb 6 05:30:00 2018 +0100 ---------------------------------------------------------------------- Jenkinsfile | 145 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 73 insertions(+), 72 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/d1ae8108/Jenkinsfile ---------------------------------------------------------------------- diff --git a/Jenkinsfile b/Jenkinsfile index c080713..94f3594 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -64,43 +64,47 @@ oses.eachWithIndex { os, indexOfOs -> try { println "Basedir = ${pwd()}." - def mvnLocalRepoDir + def mvnLocalRepoDir = null - dir('.repository') { + dir('.m2') { mvnLocalRepoDir = "${pwd()}" } println "Maven Local Repository = ${mvnLocalRepoDir}." + assert mvnLocalRepoDir != null : 'Local Maven Repository is undefined.' - dir('build') { - stage("checkout ${stageKey}") { - checkout scm - } + stage("checkout ${stageKey}") { + checkout scm + } + + def jdkTestHome = resolveToolNameToJavaPath(jdkTestName, mvnName) + def properties = ["\"-Djdk.home=${jdkTestHome}\"", "-Djacoco.skip=true"] + println("Setting JDK for testing ${properties[0]}") - def jdkTestHome = resolveToolNameToJavaPath(jdkTestName, mvnName) - def properties = ["\"-Djdk.home=${jdkTestHome}\"", "-Djacoco.skip=true"] - println("Setting JDK for testing ${properties[0]}") - - stage("build ${stageKey}") { - withMaven(jdk: jdkName, maven: mvnName, - mavenLocalRepo: mvnLocalRepoDir, mavenOpts: '-Xmx512m', - options: [ - artifactsPublisher(disabled: true), - ]) { - def script = cmd + options + goals + properties - bat script.join(' ') - } + stage("build ${stageKey}") { + withMaven(jdk: jdkName, maven: mvnName, + mavenLocalRepo: mvnLocalRepoDir, mavenOpts: '-Xmx512m', + options: [ + openTasksPublisher(disabled: true), + junitPublisher(disabled: true), + artifactsPublisher(disabled: true) + ]) { + def script = cmd + options + goals + properties + bat script.join(' ') } + } - def propertiesITs = properties + def propertiesITs = properties - stage("build-failsafe-it ${stageKey}") { + stage("build-failsafe-it ${stageKey}") { // lock('maven-surefire-its') { // timeout(time: 15, unit: 'MINUTES') { // withMaven(jdk: jdkName, maven: mvnName, // mavenLocalRepo: mvnLocalRepoDir, mavenOpts: '-Xmx512m', // options: [ // invokerPublisher(), +// openTasksPublisher(disabled: true), +// junitPublisher(disabled: true), // artifactsPublisher(disabled: true) // ]) { // def script = cmd + optionsITs + goalsITs + propertiesITs @@ -108,19 +112,18 @@ oses.eachWithIndex { os, indexOfOs -> // } // } // } - } } } finally { // Wait for INFRA installation of Pipeline Utils, use fileExists() -// if (fileExists('build/maven-failsafe-plugin/target/it') { -// zip(zipFile: "it--maven-failsafe-plugin--${stageKey}.zip", dir: 'build/maven-failsafe-plugin/target/it', archive: true) +// if (fileExists('maven-failsafe-plugin/target/it')) { +// zip(zipFile: "it--maven-failsafe-plugin--${stageKey}.zip", dir: 'maven-failsafe-plugin/target/it', archive: true) // } // -// if (fileExists('build/surefire-its/target') { -// zip(zipFile: "it--surefire-its--${stageKey}.zip", dir: 'build/surefire-its/target', archive: true) +// if (fileExists('surefire-its/target')) { +// zip(zipFile: "it--surefire-its--${stageKey}.zip", dir: 'surefire-its/target', archive: true) // } -// archiveArtifacts(artifacts: 'build/surefire-its/target/**/log.txt', allowEmptyArchive: true, fingerprint: true, onlyIfSuccessful: false) +// archiveArtifacts(artifacts: 'surefire-its/target/**/log.txt', allowEmptyArchive: true, fingerprint: true, onlyIfSuccessful: false) stage("cleanup ${stageKey}") { // clean up after ourselves to reduce disk space @@ -133,56 +136,54 @@ oses.eachWithIndex { os, indexOfOs -> try { println "Basedir = ${pwd()}." - def mvnLocalRepoDir + def mvnLocalRepoDir = null - dir('.repository') { + dir('.m2') { mvnLocalRepoDir = "${pwd()}" } println "Maven Local Repository = ${mvnLocalRepoDir}." + assert mvnLocalRepoDir != null : 'Local Maven Repository is undefined.' - dir('build') { - stage("checkout ${stageKey}") { - checkout scm - } + stage("checkout ${stageKey}") { + checkout scm + } - def jdkTestHome = resolveToolNameToJavaPath(jdkTestName, mvnName) - //https://github.com/jacoco/jacoco/issues/629 - def skipPlugins = jdk != '9' - def properties = ["\"-Djdk.home=${jdkTestHome}\"", "-Djacoco.skip=${skipPlugins}"] - println("Setting JDK for testing ${properties[0]}") + def jdkTestHome = resolveToolNameToJavaPath(jdkTestName, mvnName) + //https://github.com/jacoco/jacoco/issues/629 + def skipPlugins = jdk != '9' + def properties = ["\"-Djdk.home=${jdkTestHome}\"", "-Djacoco.skip=${skipPlugins}"] + println("Setting JDK for testing ${properties[0]}") - stage("build ${stageKey}") { - withMaven(jdk: jdkName, maven: mvnName, - mavenLocalRepo: mvnLocalRepoDir, mavenOpts: '-Xmx1g', - options: [ + stage("build ${stageKey}") { + withMaven(jdk: jdkName, maven: mvnName, + mavenLocalRepo: mvnLocalRepoDir, mavenOpts: '-Xmx1g', + options: [ findbugsPublisher(disabled: skipPlugins), openTasksPublisher(disabled: skipPlugins, ignoreCase: true, - pattern: sourcesPatternCsv(), - low: tasksViolationLow(), - normal: tasksViolationNormal(), - high: tasksViolationHigh()), + pattern: sourcesPatternCsv(), + low: tasksViolationLow(), + normal: tasksViolationNormal(), + high: tasksViolationHigh()), + junitPublisher(disabled: true), artifactsPublisher(disabled: true) - ]) { - def script = cmd + options + goals + properties - sh script.join(' ') - } + ]) { + def script = cmd + options + goals + properties + sh script.join(' ') } + } - def propertiesITs = [properties[0], '-Djacoco.skip=true'] + def propertiesITs = [properties[0], '-Djacoco.skip=true'] - stage("build-failsafe-it ${stageKey}") { + stage("build-failsafe-it ${stageKey}") { // lock('maven-surefire-its') { // timeout(time: 15, unit: 'MINUTES') { // withMaven(jdk: jdkName, maven: mvnName, // mavenLocalRepo: mvnLocalRepoDir, mavenOpts: '-Xmx1g', // options: [ // invokerPublisher(), -// openTasksPublisher(disabled: true, ignoreCase: true, -// pattern: sourcesPatternCsv(), -// low: tasksViolationLow(), -// normal: tasksViolationNormal(), -// high: tasksViolationHigh()), +// openTasksPublisher(disabled: true), +// junitPublisher(disabled: true), // artifactsPublisher(disabled: true) // ]) { // def script = cmd + optionsITs + goalsITs + propertiesITs @@ -190,7 +191,6 @@ oses.eachWithIndex { os, indexOfOs -> // } // } // } - } } } finally { if (indexOfMaven == mavens.size() - 1 && jdk == '9') { @@ -210,17 +210,18 @@ oses.eachWithIndex { os, indexOfOs -> } // Wait for INFRA installation of Pipeline Utils, use fileExists() -// if (fileExists('build/maven-failsafe-plugin/target/it') { -// zip(zipFile: "it--maven-failsafe-plugin--${stageKey}.zip", dir: 'build/maven-failsafe-plugin/target/it', archive: true) +// if (fileExists('maven-failsafe-plugin/target/it')) { +// zip(zipFile: "it--maven-failsafe-plugin--${stageKey}.zip", dir: 'maven-failsafe-plugin/target/it', archive: true) // } // -// if (fileExists('build/surefire-its/target') { -// zip(zipFile: "it--surefire-its--${stageKey}.zip", dir: 'build/surefire-its/target', archive: true) -// } + if (fileExists('surefire-its/target')) { +// zip(zipFile: "it--surefire-its--${stageKey}.zip", dir: 'surefire-its/target', archive: true) + sh 'tar czvf it2.tgz surefire-its/target' + } // -// sh 'tar czvf it1.tgz build/maven-failsafe-plugin/target/it' -// sh 'tar czvf it2.tgz build/surefire-its/target' -// archiveArtifacts(artifacts: '**/*.tgz', allowEmptyArchive: true, fingerprint: true, onlyIfSuccessful: false) +// sh 'tar czvf it1.tgz maven-failsafe-plugin/target/it' +// sh 'tar czvf it2.tgz surefire-its/target' + archiveArtifacts(artifacts: '**/*.tgz', allowEmptyArchive: true, fingerprint: true, onlyIfSuccessful: false) // archiveArtifacts(artifacts: '*.tgz', allowEmptyArchive: true, fingerprint: true, onlyIfSuccessful: false) stage("cleanup ${stageKey}") { @@ -295,7 +296,7 @@ def resolveToolNameToJavaPath(jdkToolName, mvnName) { } @NonCPS -def sourcesPatternCsv() { +static def sourcesPatternCsv() { return '**/maven-failsafe-plugin/src/main/java,' + '**/maven-surefire-common/src/main/java,' + '**/maven-surefire-plugin/src/main/java,' + @@ -310,7 +311,7 @@ def sourcesPatternCsv() { } @NonCPS -def classPatternCsv() { +static def classPatternCsv() { return '**/maven-failsafe-plugin/target/classes,' + '**/maven-surefire-common/target/classes,' + '**/maven-surefire-plugin/target/classes,' + @@ -325,23 +326,23 @@ def classPatternCsv() { } @NonCPS -def tasksViolationLow() { +static def tasksViolationLow() { return '@SuppressWarnings' } @NonCPS -def tasksViolationNormal() { +static def tasksViolationNormal() { return 'TODO,FIXME,@deprecated' } @NonCPS -def tasksViolationHigh() { +static def tasksViolationHigh() { return 'finalize(),Locale.setDefault,TimeZone.setDefault,\ System.out,System.err,System.setOut,System.setErr,System.setIn,System.exit,System.gc,System.runFinalization,System.load' } @NonCPS -def testReportsPatternCsv() { +static def testReportsPatternCsv() { return '**/maven-failsafe-plugin/target/surefire-reports/*.xml,' + '**/maven-surefire-common/target/surefire-reports/*.xml,' + '**/maven-surefire-plugin/target/surefire-reports/*.xml,' +