Skip to content

Commit b511615

Browse files
committed
[RelEng] Migrate to Maven-Daemon tool provided by RelEng-Jenkins
and only send mails on failures (not on aborted builds). Also keep only the build artifacts of the two latest builds.
1 parent 4fc02a1 commit b511615

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

JenkinsJobs/Releng/publishToMaven.jenkinsfile

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
21
pipeline {
32
options {
43
timestamps()
54
timeout(time: 120, unit: 'MINUTES')
6-
buildDiscarder(logRotator(numToKeepStr:'10'))
5+
buildDiscarder(logRotator(numToKeepStr:'10', artifactNumToKeepStr:'2'))
76
checkoutToSubdirectory('git-repo')
87
}
98
agent {
@@ -12,10 +11,10 @@ pipeline {
1211
tools {
1312
jdk 'temurin-jdk21-latest'
1413
maven 'apache-maven-latest'
14+
maven 'maven-daemon'
1515
}
1616
environment {
1717
REPO = "${WORKSPACE}/repo"
18-
PATH = "${installMavenDaemon('1.0.2')}/bin:${PATH}"
1918
CBI_AGGR = "${installLatestCbiAggr()}"
2019
// Folder ~/.m2 is not writable for builds, ensure mvnd metadata are written within the workspace.
2120
// prevent jline warning about inability to create a system terminal and increase keep-alive timeouts to increase stability in concurrent usage
@@ -168,20 +167,14 @@ pipeline {
168167
repo/**, \
169168
coordinates*.txt, artifacts*.txt'
170169
}
171-
unsuccessful {
170+
failure {
172171
emailext subject: "Publication of Maven artifacts failed",
173172
body: "Please go to ${BUILD_URL}console and check the build failure.", mimeType: 'text/plain',
174173
175174
}
176175
}
177176
}
178177

179-
def installMavenDaemon(String version) {
180-
// Temporary workaround, until https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/6241#note_4109878 is really resolved
181-
return install('mvnd', 'https://download.eclipse.org/oomph/archive/maven-mvnd-1.0.2-linux-amd64.tar.gz')
182-
}
183-
184-
185178
def installLatestCbiAggr(){
186179
return install('cbiAggr', "https://download.eclipse.org/cbi/updates/p2-aggregator/products/nightly/latest/org.eclipse.cbi.p2repo.cli.product-linux.gtk.x86_64.tar.gz") + '/cbiAggr'
187180
}

0 commit comments

Comments
 (0)