:java-version: Version of Java to set as the default Java.
Eg. openjdk8
+lf-infra-sonatype-clm
+---------------------
+
+Runs a Sonatype CLM scan against a Maven project and pushes results to
+Nexus IQ server.
+
+:Optional parameters:
+ :mvn-goals: The maven goals to perform for the build.
+ (default: clean install)
+
Job Templates
=============
:java-version: Version of Java to use for the build. (default: openjdk8)
:mvn-global-settings: The name of the Maven global settings to use for
Maven configuration. (default: global-settings)
+ :mvn-goals: The maven goals to perform for the build.
+ (default: clean install)
:mvn-opts: Sets MAVEN_OPTS. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
github-url: "https://github.com"
java-version: openjdk8
mvn-global-settings: global-settings
+ mvn-goals: clean install
mvn-opts: ""
mvn-params: ""
mvn-version: mvn35
- lf-provide-maven-settings:
global-settings-file: "{mvn-global-settings}"
settings-file: "{mvn-settings}"
- - shell: !include-raw-escape:
- - ../shell/common-variables.sh
- - ../shell/sonatype-clm.sh
+ - lf-infra-sonatype-clm:
+ mvn-goals: "{mvn-goals}"
- lf-provide-maven-settings-cleanup
- shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
- nexus-iq-policy-evaluator:
scan-patterns: "{obj:nexus_iq_scan_patterns}"
fail-build-network-error: true
+- builder:
+ name: lf-infra-sonatype-clm
+ # Run a CLM scan build with Maven
+ builders:
+ - inject:
+ properties-content: |
+ MAVEN_GOALS={mvn-goals}
+ - shell: !include-raw-escape:
+ - ../shell/common-variables.sh
+ - ../shell/sonatype-clm.sh
+
- job-template:
name: "{project-name}-maven-clm-{stream}"
id: gerrit-maven-clm
# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
# shellcheck disable=SC2086
-$MVN clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index \
+$MVN $MAVEN_GOALS dependency:tree com.sonatype.clm:clm-maven-plugin:index \
--global-settings "$GLOBAL_SETTINGS_FILE" \
--settings "$SETTINGS_FILE" \
-DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \