2018-01-31 20:44:55 -05:00
|
|
|
#!groovy
|
2018-01-31 20:46:35 -05:00
|
|
|
|
2018-09-07 15:56:31 -04:00
|
|
|
// def jdks = ["jdk8","jdk9","jdk10","jdk11"]
|
2018-09-12 20:10:46 -04:00
|
|
|
def mainJdk = "jdk11"
|
|
|
|
def jdks = [mainJdk]
|
2018-09-04 20:07:17 -04:00
|
|
|
def oss = ["linux"]
|
2018-01-31 23:29:08 -05:00
|
|
|
def builds = [:]
|
2018-02-03 18:45:25 -05:00
|
|
|
for (def os in oss) {
|
|
|
|
for (def jdk in jdks) {
|
2018-09-14 01:17:50 -04:00
|
|
|
builds[os+"_"+jdk] = getFullBuild( jdk, os, mainJdk == jdk )
|
2018-02-03 18:45:25 -05:00
|
|
|
}
|
2018-01-31 23:29:08 -05:00
|
|
|
}
|
2018-02-03 18:45:25 -05:00
|
|
|
|
2018-02-01 01:27:43 -05:00
|
|
|
parallel builds
|
2016-07-25 19:06:01 -04:00
|
|
|
|
2018-09-14 01:17:50 -04:00
|
|
|
def getFullBuild(jdk, os, mainJdk) {
|
2018-01-31 23:29:08 -05:00
|
|
|
return {
|
2018-02-03 18:46:53 -05:00
|
|
|
node(os) {
|
2018-01-31 23:29:08 -05:00
|
|
|
// System Dependent Locations
|
2018-04-20 03:48:08 -04:00
|
|
|
def mvnName = 'maven3.5'
|
2018-09-04 20:07:17 -04:00
|
|
|
def localRepo = "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}" // ".repository" //
|
2018-04-20 20:39:18 -04:00
|
|
|
def settingsName = 'oss-settings.xml'
|
2018-06-15 03:13:05 -04:00
|
|
|
def mavenOpts = '-Xms1g -Xmx4g -Djava.awt.headless=true'
|
2016-07-25 19:06:01 -04:00
|
|
|
|
2018-09-14 01:17:50 -04:00
|
|
|
stage("Build / Test - $jdk") {
|
2018-09-10 03:03:26 -04:00
|
|
|
timeout(time: 120, unit: 'MINUTES') {
|
2018-09-07 16:22:45 -04:00
|
|
|
// Checkout
|
|
|
|
checkout scm
|
|
|
|
withMaven(
|
2018-09-03 02:19:18 -04:00
|
|
|
maven: mvnName,
|
|
|
|
jdk: "$jdk",
|
|
|
|
publisherStrategy: 'EXPLICIT',
|
|
|
|
globalMavenSettingsConfig: settingsName,
|
2018-10-08 22:41:20 -04:00
|
|
|
options: [invokerPublisher()],
|
2018-09-03 02:19:18 -04:00
|
|
|
mavenOpts: mavenOpts,
|
|
|
|
mavenLocalRepo: localRepo) {
|
2018-09-07 16:22:45 -04:00
|
|
|
// Compile only
|
2018-10-03 05:21:23 -04:00
|
|
|
sh "mvn -V -B clean install -DskipTests -T6 -e -Dmaven.test.failure.ignore=false"
|
2018-09-07 16:22:45 -04:00
|
|
|
// Javadoc only
|
2018-10-03 05:21:23 -04:00
|
|
|
sh "mvn -V -B javadoc:javadoc -T6 -e -Dmaven.test.failure.ignore=false"
|
2018-09-07 16:22:45 -04:00
|
|
|
// Testing
|
2018-09-22 07:31:01 -04:00
|
|
|
sh "mvn -V -B install -Dmaven.test.failure.ignore=true -T5 -e -Djetty.testtracker.log=true -Pmongodb -Dunix.socket.tmp=" + env.JENKINS_HOME
|
2016-07-25 19:06:01 -04:00
|
|
|
|
2018-09-07 16:22:45 -04:00
|
|
|
}
|
2016-10-20 14:29:24 -04:00
|
|
|
}
|
2016-07-25 19:06:01 -04:00
|
|
|
|
2018-09-07 15:56:31 -04:00
|
|
|
// Report failures in the jenkins UI
|
2018-09-07 16:22:45 -04:00
|
|
|
junit testResults: '**/target/surefire-reports/TEST-*.xml,**/target/failsafe-reports/TEST-*.xml'
|
2018-09-07 15:56:31 -04:00
|
|
|
consoleParsers = [[parserName: 'JavaDoc'],
|
|
|
|
[parserName: 'JavaC']];
|
2018-09-07 16:22:45 -04:00
|
|
|
|
2018-09-14 01:17:50 -04:00
|
|
|
if (mainJdk) {
|
2018-09-07 15:56:31 -04:00
|
|
|
// Collect up the jacoco execution results
|
|
|
|
def jacocoExcludes =
|
2018-09-22 06:11:03 -04:00
|
|
|
// build tools
|
|
|
|
"**/org/eclipse/jetty/ant/**" + ",**/org/eclipse/jetty/maven/**" +
|
|
|
|
",**/org/eclipse/jetty/jspc/**" +
|
|
|
|
// example code / documentation
|
|
|
|
",**/org/eclipse/jetty/embedded/**" + ",**/org/eclipse/jetty/asyncrest/**" +
|
|
|
|
",**/org/eclipse/jetty/demo/**" +
|
|
|
|
// special environments / late integrations
|
|
|
|
",**/org/eclipse/jetty/gcloud/**" + ",**/org/eclipse/jetty/infinispan/**" +
|
2018-10-09 00:20:58 -04:00
|
|
|
",**/org/eclipse/jetty/osgi/**" + ",**/org/eclipse/jetty/spring/**" +
|
2018-09-22 06:11:03 -04:00
|
|
|
",**/org/eclipse/jetty/http/spi/**" +
|
|
|
|
// test classes
|
|
|
|
",**/org/eclipse/jetty/tests/**" + ",**/org/eclipse/jetty/test/**";
|
2018-09-07 15:56:31 -04:00
|
|
|
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
|
2018-09-22 06:11:03 -04:00
|
|
|
exclusionPattern: jacocoExcludes,
|
|
|
|
execPattern: '**/target/jacoco.exec',
|
|
|
|
classPattern: '**/target/classes',
|
|
|
|
sourcePattern: '**/src/main/java'
|
2018-09-07 15:56:31 -04:00
|
|
|
consoleParsers = [[parserName: 'Maven'],
|
|
|
|
[parserName: 'JavaDoc'],
|
|
|
|
[parserName: 'JavaC']];
|
2016-10-20 14:29:24 -04:00
|
|
|
}
|
2018-09-07 15:56:31 -04:00
|
|
|
|
|
|
|
// Report on Maven and Javadoc warnings
|
2018-09-07 16:22:45 -04:00
|
|
|
step([$class : 'WarningsPublisher',
|
|
|
|
consoleParsers: consoleParsers])
|
2016-08-15 18:22:53 -04:00
|
|
|
}
|
2018-01-31 20:24:31 -05:00
|
|
|
}
|
2016-07-25 19:06:01 -04:00
|
|
|
}
|
2018-01-31 20:48:13 -05:00
|
|
|
}
|
2016-07-26 10:25:23 -04:00
|
|
|
|
2018-10-03 05:21:23 -04:00
|
|
|
// vim: et:ts=2:sw=2:ft=groovy
|