Force maven to install in java jobs using scripts 07/1407/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Fri, 24 Feb 2017 20:51:11 +0000 (12:51 -0800)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Fri, 24 Feb 2017 20:51:11 +0000 (12:51 -0800)
The *version2* java jobs execute scripts that need ${MVN} to actually
operate properly. As these scripts are happening before the standard
maven build step maven is not installed yet. Ergo, we need an empty
maven build step that makes sure that it's installed.

Change-Id: I5a0979fdffa87f695b1bc575e24b04097889ea59
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
jjb/global-macros.yaml
jjb/global-templates-java.yaml

index 2d2d6c3..46c4d82 100644 (file)
             - file-id: '{settings-file}'
               variable: 'SETTINGS_FILE'
 
+# call maven-target builder with a goal of --version to force Jenkins to
+# install the needed maven version
+- builder:
+    name: maven-install
+    builders:
+      - maven-target:
+          maven-version: '{maven-version}'
+          goals: '--version'
+
 - builder:
     name: maven-docker-push-release
     builders:
index 4423d20..7147a20 100644 (file)
       - provide-maven-settings:
           global-settings-file: 'global-settings'
           settings-file: '{mvn-settings}'
+      - maven-install
 
       - inject:
           properties-file: version.properties
       - provide-maven-settings:
           global-settings-file: 'global-settings'
           settings-file: '{mvn-settings}'
+      - maven-install
 
       - inject:
           properties-file: version.properties