Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.

Commit 19d50fa

Browse files
committed
simplify Jenkinsfile
Signed-off-by: Olivier Lamy <olamy@apache.org>
1 parent 4a2d43b commit 19d50fa

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

Jenkinsfile

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,13 @@ pipeline {
4646
stage('BuildAndDeploy') {
4747
steps {
4848
timeout(120) {
49-
withMaven(maven: buildMvn, jdk: buildJdk,
50-
mavenSettingsConfig: deploySettings,
51-
mavenLocalRepo: ".repository",
52-
mavenOpts:'-XX:MaxPermSize=128m -Xmx1024m',
53-
publisherStrategy: 'EXPLICIT',
54-
options: [concordionPublisher(disabled: true), dependenciesFingerprintPublisher(disabled: true),
55-
findbugsPublisher(disabled: true), artifactsPublisher(disabled: true),
56-
invokerPublisher(disabled: true), jgivenPublisher(disabled: true),
57-
junitPublisher(disabled: true, ignoreAttachments: false),
58-
openTasksPublisher(disabled: true), pipelineGraphPublisher(disabled: true)]
59-
)
60-
{
49+
50+
withEnv(["JAVA_HOME=${ tool "$buildJdk" }",
51+
"PATH+MAVEN=${ tool "$buildJdk" }/bin:${tool "buildMvn"}/bin",
52+
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
53+
configFileProvider(
54+
[configFile(fileId: 'archiva-uid-jenkins', variable: 'GLOBAL_MVN_SETTINGS')]) {
55+
6156
// Needs a lot of time to reload the repository files, try without cleanup
6257
// Not sure, but maybe
6358
// sh "rm -rf .repository"
@@ -74,12 +69,13 @@ pipeline {
7469
// -Pci-build: Profile for CI-Server
7570
script {
7671
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'archiva-2.x') {
77-
sh "mvn clean deploy -B -U -e -fae -T2 -Pci-build -DretryFailedDeploymentCount=5"
72+
sh "mvn clean deploy -B -U -e -fae -T2 -Pci-build -DretryFailedDeploymentCount=5 -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository"
7873
} else {
79-
sh "mvn clean install -B -U -e -fae -T2 -Pci-build"
74+
sh "mvn clean install -B -U -e -fae -T2 -Pci-build -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository"
8075
}
8176
}
82-
}
77+
78+
}
8379
}
8480
}
8581
post {

0 commit comments

Comments
 (0)