Merge pull request #2216 from olamy/feature/speed_up_build

use a separated local maven repo per build and run maven in multi thread surefire configuration improvment
This commit is contained in:
Joakim Erdfelt 2018-02-26 18:09:53 -06:00 committed by GitHub
commit 61bc00694a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 72 additions and 27 deletions

87
Jenkinsfile vendored
View File

@ -1,7 +1,7 @@
#!groovy #!groovy
def jdks = ["jdk8", "jdk9"] def jdks = ["jdk8", "jdk9"]
def oss = ["linux"] //windows? def oss = ["linux"] //windows? ,"linux-docker"
def builds = [:] def builds = [:]
for (def os in oss) { for (def os in oss) {
for (def jdk in jdks) { for (def jdk in jdks) {
@ -37,7 +37,14 @@ def getFullBuild(jdk, os) {
stage('Compile') { stage('Compile') {
withEnv(mvnEnv) { withEnv(mvnEnv) {
timeout(time: 15, unit: 'MINUTES') { timeout(time: 15, unit: 'MINUTES') {
sh "mvn -V -B clean install -Dtest=None" withMaven(
maven: 'maven3',
jdk: "$jdk",
options: disableMvnReporters(),
mavenLocalRepo: "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}") {
sh "mvn -V -B clean install -Dtest=None -T6"
}
} }
} }
} }
@ -51,7 +58,13 @@ def getFullBuild(jdk, os) {
stage('Javadoc') { stage('Javadoc') {
withEnv(mvnEnv) { withEnv(mvnEnv) {
timeout(time: 20, unit: 'MINUTES') { timeout(time: 20, unit: 'MINUTES') {
sh "mvn -V -B javadoc:javadoc" withMaven(
maven: 'maven3',
jdk: "$jdk",
options: disableMvnReporters(),
mavenLocalRepo: "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}") {
sh "mvn -V -B javadoc:javadoc -T5"
}
} }
} }
} }
@ -66,41 +79,42 @@ def getFullBuild(jdk, os) {
withEnv(mvnEnv) { withEnv(mvnEnv) {
timeout(time: 90, unit: 'MINUTES') { timeout(time: 90, unit: 'MINUTES') {
// Run test phase / ignore test failures // Run test phase / ignore test failures
sh "mvn -V -B install -Dmaven.test.failure.ignore=true -Prun-its" withMaven(
maven: 'maven3',
jdk: "$jdk",
options: disableMvnReporters(),
mavenLocalRepo: "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}") {
//
sh "mvn -V -B install -Dmaven.test.failure.ignore=true -Prun-its -T3 -e -Dmaven.repo.local=${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}"
}
// withMaven doesn't label..
// Report failures in the jenkins UI // Report failures in the jenkins UI
junit testResults:'**/target/surefire-reports/TEST-*.xml' junit testResults:'**/target/surefire-reports/TEST-*.xml'
// Collect up the jacoco execution results // Collect up the jacoco execution results
def jacocoExcludes = def jacocoExcludes =
// build tools // build tools
"**/org/eclipse/jetty/ant/**" + "**/org/eclipse/jetty/ant/**" + ",**/org/eclipse/jetty/maven/**" +
",**/org/eclipse/jetty/maven/**" +
",**/org/eclipse/jetty/jspc/**" + ",**/org/eclipse/jetty/jspc/**" +
// example code / documentation // example code / documentation
",**/org/eclipse/jetty/embedded/**" + ",**/org/eclipse/jetty/embedded/**" + ",**/org/eclipse/jetty/asyncrest/**" +
",**/org/eclipse/jetty/asyncrest/**" +
",**/org/eclipse/jetty/demo/**" + ",**/org/eclipse/jetty/demo/**" +
// special environments / late integrations // special environments / late integrations
",**/org/eclipse/jetty/gcloud/**" + ",**/org/eclipse/jetty/gcloud/**" + ",**/org/eclipse/jetty/infinispan/**" +
",**/org/eclipse/jetty/infinispan/**" + ",**/org/eclipse/jetty/osgi/**" + ",**/org/eclipse/jetty/spring/**" +
",**/org/eclipse/jetty/osgi/**" +
",**/org/eclipse/jetty/spring/**" +
",**/org/eclipse/jetty/http/spi/**" + ",**/org/eclipse/jetty/http/spi/**" +
// test classes // test classes
",**/org/eclipse/jetty/tests/**" + ",**/org/eclipse/jetty/tests/**" + ",**/org/eclipse/jetty/test/**";
",**/org/eclipse/jetty/test/**"; step( [$class : 'JacocoPublisher',
step([$class: 'JacocoPublisher', inclusionPattern: '**/org/eclipse/jetty/**/*.class',
inclusionPattern: '**/org/eclipse/jetty/**/*.class', exclusionPattern: jacocoExcludes,
exclusionPattern: jacocoExcludes, execPattern : '**/target/jacoco.exec',
execPattern: '**/target/jacoco.exec', classPattern : '**/target/classes',
classPattern: '**/target/classes', sourcePattern : '**/src/main/java'] )
sourcePattern: '**/src/main/java'])
// Report on Maven and Javadoc warnings // Report on Maven and Javadoc warnings
step([$class: 'WarningsPublisher', step( [$class : 'WarningsPublisher',
consoleParsers: [ consoleParsers: [[parserName: 'Maven'],
[parserName: 'Maven'], [parserName: 'JavaDoc'],
[parserName: 'JavaDoc'], [parserName: 'JavaC']]] )
[parserName: 'JavaC']
]])
} }
if(isUnstable()) if(isUnstable())
{ {
@ -119,7 +133,13 @@ def getFullBuild(jdk, os) {
dir("aggregates/jetty-all-compact3") { dir("aggregates/jetty-all-compact3") {
withEnv(mvnEnv) { withEnv(mvnEnv) {
sh "mvn -V -B -Pcompact3 clean install" withMaven(
maven: 'maven3',
jdk: "$jdk",
options: disableMvnReporters(),
mavenLocalRepo: "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}") {
sh "mvn -V -B -Pcompact3 clean install -T5"
}
} }
} }
} }
@ -178,4 +198,17 @@ def notifyBuild(String buildStatus, String jdk)
) )
} }
def disableMvnReporters() {
return [
concordionPublisher(disabled: true),
dependenciesFingerprintPublisher(disabled: true),
findbugsPublisher(disabled: true),
artifactsPublisher(disabled: true),
invokerPublisher(disabled: true),
jgivenPublisher(disabled: true),
junitPublisher(disabled: true),
pipelineGraphPublisher(disabled: true),
openTasksPublisher(disabled: true)];
}
// vim: et:ts=2:sw=2:ft=groovy // vim: et:ts=2:sw=2:ft=groovy

View File

@ -168,6 +168,18 @@
<version>${project.version}</version> <version>${project.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.jetty.http2</groupId>
<artifactId>http2-client</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.http2</groupId>
<artifactId>http2-http-client-transport</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<reporting> <reporting>
<plugins> <plugins>