Updated Jenkinsfile.
@@ -13,20 +13,23 @@ for (def os in oss) {
parallel builds
def newBuild(os, jdk) {
+ return {
node(os) {
- def mvnName = 'maven3'
- def mvnTool = tool name: "${mvnName}", type: 'hudson.tasks.Maven$MavenInstallation'
- def jdkTool = tool name: "${jdk}", type: 'hudson.model.JDK'
- List mvnEnv = ["PATH+MVN=${mvnTool}/bin", "PATH+JDK=${jdkTool}/bin", "JAVA_HOME=${jdkTool}/", "MAVEN_HOME=${mvnTool}"]
- mvnEnv.add("MAVEN_OPTS=-Xms256m -Xmx1024m -Djava.awt.headless=true")
+ def mvnName = 'maven3.5'
+ def settingsName = 'oss-settings.xml'
+ def mvnOpts = '-Xms256m -Xmx1024m -Djava.awt.headless=true'
stage("Checkout - ${jdk}") {
checkout scm
}
stage("Build - ${jdk}") {
- withEnv(mvnEnv) {
timeout(time: 1, unit: 'HOURS') {
+ withMaven(maven: mvnName,
+ jdk: "${jdk}",
+ publisherStrategy: 'EXPLICIT',
+ globalMavenSettingsConfig: settingsName,
+ mavenOpts: mvnOpts) {
sh "mvn -V -B clean install -Dmaven.test.failure.ignore=true"
// Report failures in the jenkins UI.
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
@@ -41,11 +44,16 @@ def newBuild(os, jdk) {
}
stage("Javadoc - ${jdk}") {
- withEnv(mvnEnv) {
timeout(time: 5, unit: 'MINUTES') {
+ withMaven(maven: mvnName,
+ jdk: "${jdk}",
+ publisherStrategy: 'EXPLICIT',
+ globalMavenSettingsConfig: settingsName,
+ mavenOpts: mvnOpts) {
sh "mvn -V -B javadoc:javadoc"
}
}
}
}
}
+}
