You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2019/05/07 19:49:40 UTC

[jspwiki] 01/02: simplify Jenkinsfile by replacing withEnv and tool definitions with withMaven steps

This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 3ee179e8081ebf88cb1c8f547048e40200507813
Author: juanpablo <ju...@apache.org>
AuthorDate: Tue May 7 21:46:01 2019 +0200

    simplify Jenkinsfile by replacing withEnv and tool definitions with withMaven steps
---
 Jenkinsfile | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 6d1304e..663a38e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -28,12 +28,6 @@ try {
     def pom
 
     node( 'ubuntu' ) {
-        def JAVA_JDK_8=tool name: 'JDK 1.8 (latest)', type: 'hudson.model.JDK'
-        echo "Will use Java $JAVA_JDK_8"
-
-        def MAVEN_3_LATEST=tool name: 'Maven 3 (latest)', type: 'hudson.tasks.Maven$MavenInstallation'
-        echo "Will use Maven $MAVEN_3_LATEST"
-
         stage( 'clean ws' ) {
             cleanWs()
         }
@@ -41,10 +35,10 @@ try {
         stage( 'build source' ) {
             dir( build ) {
                 git url: buildRepo, poll: true
-                withEnv( [ "Path+JDK=$JAVA_JDK_8/bin", "Path+MAVEN=$MAVEN_3_LATEST/bin", "JAVA_HOME=$JAVA_JDK_8" ] ) {
+                withMaven(jdk: 'JDK 1.8 (latest)', maven: 'Maven 3 (latest)' ) {
                     withSonarQubeEnv( 'ASF Sonar Analysis' ) {
                         echo "Will use SonarQube instance at $SONAR_HOST_URL"
-                        sh "mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Pattach-additional-artifacts $SONAR_MAVEN_GOAL -e -up"
+                        sh "mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Pattach-additional-artifacts $SONAR_MAVEN_GOAL -up"
                     }
                     pom = readMavenPom file: 'pom.xml'
                     writeFile file: 'target/classes/apidocs.txt', text: 'file created in order to allow aggregated javadoc generation, target/classes is needed for all modules'
@@ -55,7 +49,7 @@ try {
         }
 
         stage( 'build website' ) {
-            withEnv( [ "Path+JDK=$JAVA_JDK_8/bin", "Path+MAVEN=$MAVEN_3_LATEST/bin", "JAVA_HOME=$JAVA_JDK_8" ] ) {
+            withMaven(jdk: 'JDK 1.8 (latest)', maven: 'Maven 3 (latest)' ) {
                 dir( jbake ) {
                     git branch: jbake, url: siteRepo, credentialsId: creds, poll: false
                     sh 'mvn clean process-resources -Dplugin.japicmp.jspwiki-new=' + pom.version