From 38dbf044a8a5db4ae47fd1cb6ef9ad5ed0aef8cd Mon Sep 17 00:00:00 2001 From: Suresh Channamallu Date: Tue, 16 Jul 2019 13:36:29 -0400 Subject: [PATCH] Add option to pass JAVA_OPTIONS 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 Change-Id: I0842f222fc7abf11b258b0691167b701bb319458 --- jjb/lf-maven-jobs.yaml | 6 ++++++ .../fix-add-java-option-support-sonar-jobs-cad478912e491936.yaml | 7 +++++++ shell/maven-sonar.sh | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-add-java-option-support-sonar-jobs-cad478912e491936.yaml diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 4b4ad8e7..a37aaac5 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -1105,6 +1105,7 @@ 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: "" @@ -1143,6 +1144,11 @@ 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 index 00000000..63b733fa --- /dev/null +++ b/releasenotes/notes/fix-add-java-option-support-sonar-jobs-cad478912e491936.yaml @@ -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. diff --git a/shell/maven-sonar.sh b/shell/maven-sonar.sh index e78d156f..d370748b 100644 --- a/shell/maven-sonar.sh +++ b/shell/maven-sonar.sh @@ -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 -- 2.16.6