From 9519255f8c0200075f238d2e015fd710d54d879e Mon Sep 17 00:00:00 2001 From: Johannes Schnatterer Date: Thu, 12 Jul 2018 11:15:24 +0200 Subject: [PATCH] Jenkins: Do release build only on main branch. JavaDoc takes ages, we want faster feedback! --- Jenkinsfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 30a09458f8..ff9c5ae4d3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ node() { // No specific label catchError { - Maven mvn = new MavenWrapper(this) + Maven mvn = setupMavenBuild() // Maven build specified it must be 1.8.0-101 or newer def javaHome = tool 'JDK-1.8.0-101+' @@ -26,8 +26,7 @@ node() { // No specific label } stage('Build') { - // TODO release build only on default? or 2.0.0-M3 -> JavaDoc takes ages - mvn 'clean install -DskipTests -DperformRelease -Dmaven.javadoc.failOnError=false' + mvn 'clean install -DskipTests' } stage('Unit Test') { @@ -59,6 +58,18 @@ node() { // No specific label // Change this as when we go back to default - necessary for proper SonarQube analysis String mainBranch = "2.0.0-m3" +Maven setupMavenBuild() { + Maven mvn = new MavenWrapper(this) + + if (env.BRANCH_NAME == "master") { + // Release starts javadoc, which takes very long, so do only for certain branches + mvn.additionalArgs += ' -DperformRelease' + // JDK8 is more strict, we should fix this before the next release. Right now, this is just not the focus, yet. + mvn.additionalArgs += ' -Dmaven.javadoc.failOnError=false' + } + return mvn +} + void analyzeWith(Maven mvn) { withSonarQubeEnv('sonarcloud.io') {