Add option to pass JAVA_OPTIONS 26/16226/9
authorSuresh Channamallu <schannamallu@linuxfoundation.org>
Tue, 16 Jul 2019 17:36:29 +0000 (13:36 -0400)
committerSuresh Channamallu <schannamallu@linuxfoundation.org>
Wed, 17 Jul 2019 19:07:18 +0000 (15:07 -0400)
JAVA_OPTIONS are required to execute sonar jobs
Currently there is no options to pass this variable
so adding this option to pass from the project.yaml

Issue: RELENG-2152
Signed-off-by: Suresh Channamallu <schannamallu@linuxfoundation.org>
Change-Id: I0842f222fc7abf11b258b0691167b701bb319458

jjb/lf-maven-jobs.yaml
releasenotes/notes/fix-add-java-option-support-sonar-jobs-cad478912e491936.yaml [new file with mode: 0644]
shell/maven-sonar.sh

index 4b4ad8e..a37aaac 100644 (file)
     git-url: "$GIT_URL/$PROJECT"
     github-url: "https://github.com"
     java-version: openjdk8
+    java-opts: ""
     mvn-global-settings: global-settings
     mvn-goals: clean install
     mvn-opts: ""
           name: ARCHIVE_ARTIFACTS
           default: "{archive-artifacts}"
           description: Artifacts to archive to the logs server.
+      - string:
+          name: JAVA_OPTS
+          default: "{java-opts}"
+          description: |
+            Java options. Example: -Xmx1024m
       - string:
           name: SONAR_MAVEN_GOAL
           default: "{sonar-mvn-goal}"
diff --git a/releasenotes/notes/fix-add-java-option-support-sonar-jobs-cad478912e491936.yaml b/releasenotes/notes/fix-add-java-option-support-sonar-jobs-cad478912e491936.yaml
new file mode 100644 (file)
index 0000000..63b733f
--- /dev/null
@@ -0,0 +1,7 @@
+---
+fixes:
+  - |
+    Add support for JAVA_OPTIONS in sonar job.
+    Some of the maven build options in the sonar job require to
+    set the JAVA_OPTIONS to specific value for the build to pass
+    This option will help to pass the JAVA_OPTIONS from the template.
index e78d156..d370748 100644 (file)
@@ -25,7 +25,7 @@ params+=("--settings $SETTINGS_FILE")
 
 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
 # shellcheck disable=SC2086
-$MVN $MAVEN_GOALS \
+_JAVA_OPTIONS="$JAVA_OPTS" $MVN $MAVEN_GOALS \
     -e -Dsonar \
     ${params[*]} \
     $MAVEN_OPTIONS $MAVEN_PARAMS