Prioritize MAVEN_PARAMS to override OPTIONS 76/8176/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 28 Dec 2017 17:21:27 +0000 (12:21 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 28 Dec 2017 17:33:17 +0000 (12:33 -0500)
MAVEN_PARAMS (user defined) can override MAVEN_OPTIONS (gjjb defined)
but only if it comes last on the CLI. Re-shuffle the variables so that
the desired prioritization can take affect.

RT 50181
Change-Id: Ib79cf11625e9b2d1f279b721f3a90a31e04020dc
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
21 files changed:
.jjb-test/expected-xml/gerrit-maven-maven-clm-master
.jjb-test/expected-xml/gerrit-maven-maven-javadoc-publish-master
.jjb-test/expected-xml/gerrit-maven-maven-javadoc-verify-master
.jjb-test/expected-xml/gerrit-maven-maven-merge-master
.jjb-test/expected-xml/gerrit-maven-maven-release-master
.jjb-test/expected-xml/gerrit-maven-maven-verify-deps-master-mvn33-openjdk8
.jjb-test/expected-xml/gerrit-maven-maven-verify-master-mvn33-openjdk8
.jjb-test/expected-xml/gerrit-maven-sonar
.jjb-test/expected-xml/github-maven-maven-clm-master
.jjb-test/expected-xml/github-maven-maven-javadoc-publish-master
.jjb-test/expected-xml/github-maven-maven-javadoc-verify-master
.jjb-test/expected-xml/github-maven-maven-merge-master
.jjb-test/expected-xml/github-maven-maven-release-master
.jjb-test/expected-xml/github-maven-maven-verify-master-mvn33-openjdk8
.jjb-test/expected-xml/github-maven-sonar
shell/deploy-maven-file.sh
shell/maven-build-deps.sh
shell/maven-build.sh
shell/maven-javadoc-generate.sh
shell/maven-sonar.sh
shell/sonatype-clm.sh

index c9ad3ca..e028a8a 100644 (file)
@@ -238,7 +238,7 @@ $MVN clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 </command>
     </hudson.tasks.Shell>
     <hudson.tasks.Shell>
index 8efd314..6c3e0a1 100644 (file)
@@ -325,7 +325,7 @@ $MVN clean install javadoc:aggregate \
     -Dfindbugs.skip=true \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 mv &quot;$WORKSPACE/target/site/apidocs&quot; &quot;$JAVADOC_DIR&quot;
 
index 961c75d..d7f6d75 100644 (file)
@@ -291,7 +291,7 @@ $MVN clean install javadoc:aggregate \
     -Dfindbugs.skip=true \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 mv &quot;$WORKSPACE/target/site/apidocs&quot; &quot;$JAVADOC_DIR&quot;
 </command>
index ef87513..f64dc74 100644 (file)
@@ -465,7 +465,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 #!/bin/bash
 # SPDX-License-Identifier: EPL-1.0
index 568bdf4..58e56b1 100644 (file)
@@ -434,7 +434,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 #!/bin/bash
 # SPDX-License-Identifier: EPL-1.0
index e49032c..107f2ce 100644 (file)
@@ -354,7 +354,7 @@ for project in &quot;${PROJECTS[@]}&quot;; do
         -DskipTests=true \
         --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
         --settings &quot;$SETTINGS_FILE&quot; \
-        $MAVEN_PARAMS $MAVEN_OPTIONS
+        $MAVEN_OPTIONS $MAVEN_PARAMS
     popd
 done
 </command>
@@ -410,7 +410,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 </command>
     </hudson.tasks.Shell>
     <hudson.tasks.Shell>
index 38a8f9a..45f4d4a 100644 (file)
@@ -381,7 +381,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 </command>
     </hudson.tasks.Shell>
     <hudson.tasks.Shell>
index 6e03893..e48e5e3 100644 (file)
@@ -291,7 +291,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
 # shellcheck disable=SC2086
@@ -300,7 +300,7 @@ $MVN $SONAR_MAVEN_GOAL \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 </command>
     </hudson.tasks.Shell>
     <hudson.tasks.Shell>
index d93f761..ddd663c 100644 (file)
@@ -233,7 +233,7 @@ $MVN clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 </command>
     </hudson.tasks.Shell>
     <hudson.tasks.Shell>
index 38d4650..07cf871 100644 (file)
@@ -301,7 +301,7 @@ $MVN clean install javadoc:aggregate \
     -Dfindbugs.skip=true \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 mv &quot;$WORKSPACE/target/site/apidocs&quot; &quot;$JAVADOC_DIR&quot;
 
index 8a09890..6c573c6 100644 (file)
@@ -253,7 +253,7 @@ $MVN clean install javadoc:aggregate \
     -Dfindbugs.skip=true \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 mv &quot;$WORKSPACE/target/site/apidocs&quot; &quot;$JAVADOC_DIR&quot;
 </command>
index 6f84d99..f5e708c 100644 (file)
@@ -423,7 +423,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 #!/bin/bash
 # SPDX-License-Identifier: EPL-1.0
index 2b67574..4406105 100644 (file)
@@ -402,7 +402,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 #!/bin/bash
 # SPDX-License-Identifier: EPL-1.0
index b859508..1cc1c19 100644 (file)
@@ -337,7 +337,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 </command>
     </hudson.tasks.Shell>
     <hudson.tasks.Shell>
index 710c2ec..13a3a85 100644 (file)
@@ -256,7 +256,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
 # shellcheck disable=SC2086
@@ -265,7 +265,7 @@ $MVN $SONAR_MAVEN_GOAL \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 </command>
     </hudson.tasks.Shell>
     <hudson.tasks.Shell>
index dfb9a5a..338a8c3 100644 (file)
@@ -44,6 +44,6 @@ do
                               "$file" \
                               -b "$MVN" \
                               -g "$GROUP_ID" \
-                              -p "$MAVEN_PARAMS $MAVEN_OPTIONS" \
+                              -p "$MAVEN_OPTIONS $MAVEN_PARAMS" \
                               |& tee "$DEPLOY_LOG"
 done < <(find "$UPLOAD_FILES_PATH" -type f -name "*")
index fdb29b2..bf53bf5 100644 (file)
@@ -34,6 +34,6 @@ for project in "${PROJECTS[@]}"; do
         -DskipTests=true \
         --global-settings "$GLOBAL_SETTINGS_FILE" \
         --settings "$SETTINGS_FILE" \
-        $MAVEN_PARAMS $MAVEN_OPTIONS
+        $MAVEN_OPTIONS $MAVEN_PARAMS
     popd
 done
index 0928c12..4585138 100644 (file)
@@ -25,4 +25,4 @@ $MVN clean deploy \
     --global-settings "$GLOBAL_SETTINGS_FILE" \
     --settings "$SETTINGS_FILE" \
     -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
index 02a49e3..6199b4d 100644 (file)
@@ -30,6 +30,6 @@ $MVN clean install javadoc:aggregate \
     -Dfindbugs.skip=true \
     --global-settings "$GLOBAL_SETTINGS_FILE" \
     --settings "$SETTINGS_FILE" \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 mv "$WORKSPACE/target/site/apidocs" "$JAVADOC_DIR"
index 4a3bdb8..525125b 100644 (file)
@@ -26,7 +26,7 @@ $MVN clean deploy \
     --global-settings "$GLOBAL_SETTINGS_FILE" \
     --settings "$SETTINGS_FILE" \
     -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 
 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
 # shellcheck disable=SC2086
@@ -35,4 +35,4 @@ $MVN $SONAR_MAVEN_GOAL \
     --global-settings "$GLOBAL_SETTINGS_FILE" \
     --settings "$SETTINGS_FILE" \
     -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
index 4cfdfb5..3be390d 100644 (file)
@@ -25,4 +25,4 @@ $MVN clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index \
     --global-settings "$GLOBAL_SETTINGS_FILE" \
     --settings "$SETTINGS_FILE" \
     -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS