@@ -6,45 +6,23 @@ pipeline {
66 options {
77 skipDefaultCheckout()
88 durabilityHint(' PERFORMANCE_OPTIMIZED' )
9- // buildDiscarder logRotator( numToKeepStr: '60' )
109 disableRestartFromStage()
1110 }
1211 stages {
13- stage(" Parallel Stage" ) {
14- parallel {
15-
16- stage(" Build / Test - JDK17" ) {
17- agent { node { label ' ubuntu' } }
18- steps {
19- timeout(time : 210 , unit : ' MINUTES' ) {
20- checkout scm
21- mavenBuild(" jdk_17_latest" , " -Djacoco.skip=true" )
22- script {
23- properties([buildDiscarder(logRotator(artifactNumToKeepStr : ' 5' , numToKeepStr : env. BRANCH_NAME == ' master' ? ' 30' : ' 5' ))])
24- if (env. BRANCH_NAME == ' master' ) {
25- withEnv([" JAVA_HOME=${ tool "jdk_17_latest"} " ,
26- " PATH+MAVEN=${ tool "jdk_17_latest" } /bin:${ tool "maven_3_latest"} /bin" ,
27- " MAVEN_OPTS=-Xms4G -Xmx4G -Djava.awt.headless=true" ]) {
28- sh " mvn clean deploy -DdeployAtEnd=true -B"
29- }
30- }
31- }
12+ stage(" Build / Test - JDK17" ) {
13+ agent { node { label ' ubuntu' } }
14+ steps {
15+ timeout(time : 210 , unit : ' MINUTES' ) {
16+ checkout scm
17+ mavenBuild(" jdk_17_latest" , " " )
18+ script {
19+ properties([buildDiscarder(logRotator(artifactNumToKeepStr : ' 5' , numToKeepStr : isDeployedBranch() ? ' 30' : ' 5' ))])
20+ if (isDeployedBranch()) {
21+ withEnv([" JAVA_HOME=${ tool "jdk_17_latest"} " ,
22+ " PATH+MAVEN=${ tool "jdk_17_latest" } /bin:${ tool "maven_3_latest"} /bin" ,
23+ " MAVEN_OPTS=-Xms4G -Xmx4G -Djava.awt.headless=true" ]) {
24+ sh " mvn clean deploy -DdeployAtEnd=true -B"
3225 }
33- }
34- }
35-
36- stage(" Build / Test - JDK21" ) {
37- agent { node { label ' ubuntu' } }
38- steps {
39- timeout(time : 210 , unit : ' MINUTES' ) {
40- checkout scm
41- // jacoco is definitely too slow
42- mavenBuild(" jdk_21_latest" , " " ) // "-Pjacoco jacoco-aggregator:report-aggregate-all"
43- // recordIssues id: "analysis-jdk17", name: "Static Analysis jdk17", aggregatingResults: true, enabledForFailure: true,
44- // tools: [mavenConsole(), java(), checkStyle(), errorProne(), spotBugs(), javaDoc()],
45- // skipPublishingChecks: true, skipBlames: true
46- // recordCoverage id: "coverage-jdk21", name: "Coverage jdk21", tools: [[parser: 'JACOCO',pattern: 'target/site/jacoco-aggregate/jacoco.xml']],
47- // sourceCodeRetention: 'MODIFIED', sourceDirectories: [[path: 'src/main/java']]
4826 }
4927 }
5028 }
@@ -53,8 +31,13 @@ pipeline {
5331 }
5432}
5533
34+ boolean isDeployedBranch () {
35+ return env. BRANCH_NAME == ' master' || env. BRANCH_NAME == ' maven-4.0.x' || env. BRANCH_NAME == ' maven-3.9.x'
36+ }
37+
5638/**
5739 * To other developers, if you are using this method above, please use the following syntax.
40+ * By default this method does NOT execute ITs anymore, just "install".
5841 *
5942 * mavenBuild("<jdk>", "<profiles> <goals> <plugins> <properties>"
6043 *
@@ -65,21 +48,15 @@ def mavenBuild(jdk, extraArgs) {
6548 script {
6649 try {
6750 withEnv([" JAVA_HOME=${ tool "$jdk"} " ,
68- " PATH+MAVEN=${ tool "$jdk" } /bin:${ tool "maven_3_latest"} /bin" ,
51+ " PATH+MAVEN=${ tool "$jdk"} /bin:${ tool "maven_3_latest"} /bin" ,
6952 " MAVEN_OPTS=-Xms4G -Xmx4G -Djava.awt.headless=true" ]) {
70- sh " mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper -Dmaven=3.9.9"
71- sh " ./mvnw clean install -B -U -e -DskipTests -PversionlessMavenDist -V -DdistributionTargetDir=${ env.WORKSPACE} /.apache-maven-master"
72- // we use two steps so that we can cache artifacts downloaded from Maven Central repository
73- // without installing any local artifacts to not pollute the cache
74- sh " echo package Its"
75- sh " ./mvnw package -DskipTests -e -B -V -Prun-its -Dmaven.repo.local=${ env.WORKSPACE} /.repository/cached"
53+ sh " mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper -Dmaven=3.9.10"
7654 sh " echo run Its"
77- sh " ./mvnw install -Pci $e xtraArgs -Dmaven.home= ${ env.WORKSPACE } /.apache-maven-master - e -B -V -Prun-its -Dmaven.repo.local= ${ env.WORKSPACE } /.repository/local -Dmaven.repo.local.tail= ${ env.WORKSPACE } /.repository/cached "
55+ sh " ./mvnw - e -B -V install $e xtraArgs "
7856 }
7957 }
8058 finally {
8159 junit testResults : ' **/target/test-results-surefire/*.xml' , allowEmptyResults : true
8260 }
8361 }
8462}
85- // vim: et:ts=2:sw=2:ft=groovy
0 commit comments