Merge "Allow SONAR_MAVEN_GOAL to be configurable"
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 3 Jan 2018 16:22:37 +0000 (16:22 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Wed, 3 Jan 2018 16:22:37 +0000 (16:22 +0000)
1  2 
.jjb-test/expected-xml/gerrit-maven-sonar
.jjb-test/expected-xml/github-maven-sonar

@@@ -100,13 -100,21 +100,21 @@@ For example '&lt;1.0.0' or '&gt;=1.0.0,
            <name>STAGING_PROFILE_ID</name>
            <description>Nexus staging profile ID.
  </description>
-           <defaultValue>uuddlrlrba</defaultValue>
+           <defaultValue/>
          </hudson.model.StringParameterDefinition>
          <hudson.model.StringParameterDefinition>
            <name>ARCHIVE_ARTIFACTS</name>
            <description>Artifacts to archive to the logs server.</description>
            <defaultValue/>
          </hudson.model.StringParameterDefinition>
+         <hudson.model.StringParameterDefinition>
+           <name>SONAR_MAVEN_GOAL</name>
+           <description>Maven goals to pass to the Sonar call. Typically sonar:sonar
+ however to use a specific version of the sonar-maven-plugin we
+ can call &quot;org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar&quot;.
+ </description>
+           <defaultValue>sonar:sonar</defaultValue>
+         </hudson.model.StringParameterDefinition>
        </parameterDefinitions>
      </hudson.model.ParametersDefinitionProperty>
    </properties>
      </hudson.tasks.Shell>
      <EnvInjectBuilder>
        <info>
-         <propertiesContent>SONAR_HOST_URL=$SONAR_URL
- SONAR_MAVEN_GOAL=sonar:sonar
- </propertiesContent>
+         <propertiesContent>SONAR_HOST_URL=$SONAR_URL</propertiesContent>
        </info>
      </EnvInjectBuilder>
      <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
@@@ -291,7 -297,7 +297,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 -306,7 +306,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>
@@@ -95,13 -95,21 +95,21 @@@ For example '&lt;1.0.0' or '&gt;=1.0.0,
            <name>STAGING_PROFILE_ID</name>
            <description>Nexus staging profile ID.
  </description>
-           <defaultValue>uuddlrlrba</defaultValue>
+           <defaultValue/>
          </hudson.model.StringParameterDefinition>
          <hudson.model.StringParameterDefinition>
            <name>ARCHIVE_ARTIFACTS</name>
            <description>Artifacts to archive to the logs server.</description>
            <defaultValue/>
          </hudson.model.StringParameterDefinition>
+         <hudson.model.StringParameterDefinition>
+           <name>SONAR_MAVEN_GOAL</name>
+           <description>Maven goals to pass to the Sonar call. Typically sonar:sonar
+ however to use a specific version of the sonar-maven-plugin we
+ can call &quot;org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar&quot;.
+ </description>
+           <defaultValue>sonar:sonar</defaultValue>
+         </hudson.model.StringParameterDefinition>
        </parameterDefinitions>
      </hudson.model.ParametersDefinitionProperty>
    </properties>
      </hudson.tasks.Shell>
      <EnvInjectBuilder>
        <info>
-         <propertiesContent>SONAR_HOST_URL=$SONAR_URL
- SONAR_MAVEN_GOAL=sonar:sonar
- </propertiesContent>
+         <propertiesContent>SONAR_HOST_URL=$SONAR_URL</propertiesContent>
        </info>
      </EnvInjectBuilder>
      <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
@@@ -256,7 -262,7 +262,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 -271,7 +271,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>