forked from madgnome/h2spec-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
85 lines (82 loc) · 2.83 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!groovy
pipeline {
agent none
options {
disableConcurrentBuilds()
durabilityHint('PERFORMANCE_OPTIMIZED')
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '5'))
timeout(time: 15, unit: 'MINUTES')
skipDefaultCheckout()
}
stages {
stage( "Parallel Stage" ) {
parallel {
stage( "Build / Test - JDK11" ) {
agent { node { label 'linux' } }
options { timeout( time: 120, unit: 'MINUTES' ) }
steps {
checkout scm
mavenBuild( "jdk8", "clean install javadoc:jar" )
// Collect up the jacoco execution results
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
exclusionPattern: '',
execPattern: '**/target/jacoco.exec',
classPattern: '**/target/classes',
sourcePattern: '**/src/main/java'
recordIssues id: "jdk11", name: "Static Analysis jdk8", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser(), errorProne()]
script {
if ( env.BRANCH_NAME == 'master' )
{
mavenBuild( "jdk8", "deploy" )
}
}
}
}
stage( "Build / Test - JDK17" ) {
agent { node { label 'linux' } }
options { timeout( time: 120, unit: 'MINUTES' ) }
steps {
checkout scm
mavenBuild( "jdk17", "clean install javadoc:jar" )
}
}
stage( "Build / Test - JDK21" ) {
agent { node { label 'linux' } }
options { timeout( time: 120, unit: 'MINUTES' ) }
steps {
checkout scm
mavenBuild( "jdk21", "clean install javadoc:jar" )
}
}
}
}
}
}
/**
* To other developers, if you are using this method above, please use the following syntax.
*
* mavenBuild("<jdk>", "<profiles> <goals> <plugins> <properties>"
*
* @param jdk the jdk tool name (in jenkins) to use for this build
* @param cmdline the command line in "<profiles> <goals> <properties>"`format.
* @return the Jenkinsfile step representing a maven build
*/
def mavenBuild(jdk, cmdline) {
script {
try {
withEnv(["JAVA_HOME=${ tool "$jdk" }",
"PATH+MAVEN=${ tool "$jdk" }/bin:${tool "maven3"}/bin",
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider(
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Pci -V -B -e $cmdline"
}
}
}
finally
{
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true
}
}
}
// vim: et:ts=2:sw=2:ft=groovy