Skip to content

Commit

Permalink
New ${devMode} property
Browse files Browse the repository at this point in the history
that will be true only when the "development" profile is active.
"publish" profile may not be activated at the same time as "development"
profile.
  • Loading branch information
ao-apps committed Sep 17, 2023
1 parent e38f154 commit 6ca5331
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,16 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1
mavenLocalRepo: ".m2/repository-jdk-$deployJdk",
jdk: "jdk-$deployJdk"
) {
sh "${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy,publish deploy"
// "publish" profile may not be enabled at the same time as "development" profile,
// disable for any project that always has "development" profile enabled.
sh """#!/bin/bash
if [ -f profile.d/development ]
then
${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy deploy
else
${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy,publish deploy
fi
"""
}
// Restore surefire-reports
sh restoreSurefireReportsScript()
Expand Down
11 changes: 10 additions & 1 deletion book/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,16 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1
mavenLocalRepo: ".m2/repository-jdk-$deployJdk",
jdk: "jdk-$deployJdk"
) {
sh "${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy,publish deploy"
// "publish" profile may not be enabled at the same time as "development" profile,
// disable for any project that always has "development" profile enabled.
sh """#!/bin/bash
if [ -f profile.d/development ]
then
${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy deploy
else
${niceCmd}$MVN_CMD $mvnCommon -Pnexus,jenkins-deploy,publish deploy
fi
"""
}
// Restore surefire-reports
sh restoreSurefireReportsScript()
Expand Down

0 comments on commit 6ca5331

Please sign in to comment.