c3ab35b3719b0fc622e5b8777aa97464ff3138e0
[releng/global-jjb.git] / docs / jjb / lf-maven-jobs.rst
1 ##########
2 Maven Jobs
3 ##########
4
5 Job Groups
6 ==========
7
8 .. include:: ../job-groups.rst
9
10 Below is a list of Maven job groups:
11
12 .. literalinclude:: ../../jjb/lf-maven-job-groups.yaml
13    :language: yaml
14
15
16 Macros
17 ======
18
19 lf-infra-maven-sonar
20 --------------------
21
22 Runs Sonar against a Maven project.
23
24 :Required Parameters:
25
26     :java-version: Version of Java to execute Sonar with. (default: openjdk11)
27     :mvn-version: Version of Maven to execute Sonar with.
28     :mvn-settings: Maven settings.xml file containing credentials to use.
29
30 lf-infra-maven-sonarcloud
31 -------------------------
32
33 Runs Sonar against a Maven project and pushes results to SonarCloud.
34
35 :Required Parameters:
36
37     :java-version: Version of Java to execute Maven build. (default: openjdk11)
38     :mvn-version: Version of Maven to execute Sonar with.
39     :mvn-settings: Maven settings.xml file containing credentials to use.
40     :sonarcloud-project-key: SonarCloud project key.
41     :sonarcloud-project-organization: SonarCloud project organization.
42     :sonarcloud-api-token: SonarCloud API Token.
43     :sonarcloud-java-version: Version of Java to run the Sonar scan. (default: openjdk11)
44     :sonarcloud-qualitygate-wait: SonarCloud flag that forces the analysis step to
45         wait for the quality gate result. (default: false)
46
47 lf-maven-build
48 --------------
49
50 Calls the maven build script to perform a maven build.
51
52 :Required parameters:
53
54     :mvn-goals: The maven goals to perform for the build.
55         (default: clean deploy)
56
57 lf-maven-common
58 ---------------
59
60 Common Jenkins configuration for Maven jobs.
61
62 lf-maven-deploy
63 ---------------
64
65 Calls the maven deploy script to push artifacts to Nexus.
66
67 lf-maven-versions-plugin
68 ------------------------
69
70 Conditionally calls Maven versions plugin to set, update and commit the maven `versions:set`.
71
72 :Required Parameters:
73
74     :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
75     :version-properties-file: Name and path of the version properties file.
76         (default: version.properties)
77     :mvn-version: Version of Maven to execute Sonar with.
78     :mvn-pom: Location of pom.xml.
79     :mvn-settings: Maven settings.xml file containing credentials to use.
80
81 lf-maven-stage
82 --------------
83
84 Calls the maven stage script to push artifacts to a Nexus staging repository.
85
86 :Required Parameters:
87
88     :mvn-global-settings: The name of the Maven global settings to use for
89         Maven configuration.
90     :mvn-settings: The name of settings file containing credentials for the project.
91
92 lf-update-java-alternatives
93 ---------------------------
94
95 Setup Java alternatives for the Distro.
96
97 :Required Parameters:
98
99     :java-version: Version of Java to set as the default Java.
100         Eg. openjdk11
101
102 lf-infra-sonatype-clm
103 ---------------------
104
105 Runs a Sonatype CLM scan against a Maven project and pushes results to
106 Nexus IQ server.
107
108 :Optional parameters:
109     :mvn-goals: The maven goals to perform for the build.
110         (default: clean install)
111
112 lf-infra-maven-sbom-generator
113 -----------------------------
114
115 Runs a specific version of SPDX SBOM Generator tool to generate a report.
116 The calling job template sets the version to run in the SBOM_GENERATOR_VERSION parameter.
117
118 :Optional parameters:
119     :sbom-flags: SBOM generator options. See https://github.com/opensbom-generator/spdx-sbom-generator
120
121 Job Templates
122 =============
123
124 Maven CLM
125 ---------
126
127 Produces a CLM scan of the code into Nexus IQ Server.
128
129 :Template Names:
130
131     - {project-name}-maven-clm-{stream}
132     - gerrit-maven-clm
133     - github-maven-clm
134
135 :Comment Trigger: run-clm
136
137 :Required parameters:
138
139     :build-node:    The node to run build on.
140     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
141     :mvn-settings: The name of settings file containing credentials for the project.
142
143 :Optional parameters:
144
145     :branch: The branch to build against. (default: master)
146     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
147     :build-timeout: Timeout in minutes before aborting build. (default: 60)
148     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
149     :java-version: Version of Java to use for the build. (default: openjdk11)
150     :mvn-global-settings: The name of the Maven global settings to use for
151         Maven configuration. (default: global-settings)
152     :mvn-goals: The maven goals to perform for the build.
153         (default: clean install)
154     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
155     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
156     :mvn-version: Version of maven to use. (default: mvn35)
157     :nexus-iq-namespace: Insert a namespace to project AppID for projects that
158         share a Nexus IQ system to avoid project name collision. We recommend
159         inserting a trailing - dash if using this parameter.
160         For example 'odl-'. (default: '')
161     :nexus-iq-stage: Sets the **stage** which the policy evaluation will run
162         against on the Nexus IQ Server. (default: 'build')
163     :stream: Keyword that represents a release code-name.
164         Often the same as the branch. (default: master)
165     :submodule-recursive: Whether to checkout submodules recursively.
166         (default: true)
167     :submodule-timeout: Timeout (in minutes) for checkout operation.
168         (default: 10)
169     :submodule-disable: Disable submodule checkout operation.
170         (default: false)
171
172     :gerrit_merge_triggers: Override Gerrit Triggers.
173
174 Maven JavaDoc Publish
175 ---------------------
176
177 Produces and publishes javadocs for a Maven project.
178
179 Expects javadocs to be available in ``$WORKSPACE/target/site/apidocs``, but
180 overrideable with the ``mvn-dir`` parameter. If set, will search for javadocs
181 in ``$WORKSPACE/{mvn-dir}/target/site/apidocs``.
182
183 :Template Names:
184
185     - {project-name}-maven-javadoc-publish-{stream}-{java-version}
186     - gerrit-maven-javadoc-publish
187     - github-maven-javadoc-publish
188
189 :Comment Trigger: remerge
190
191 :Required parameters:
192
193     :build-node: The node to run build on.
194     :javadoc-path: The path in Nexus to deploy javadoc to.
195     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
196     :mvn-settings: The name of settings file containing credentials for the project.
197     :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
198         (Note: This setting is generally configured in ``defaults.yaml``.)
199
200 :Optional parameters:
201
202     :branch: The branch to build against. (default: master)
203     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
204     :build-timeout: Timeout in minutes before aborting build. (default: 60)
205     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
206     :java-version: Version of Java to use for the build. (default: openjdk11)
207     :mvn-dir: Directory supplied as argument to -f option (default: '.')
208     :mvn-global-settings: The name of the Maven global settings to use for
209         Maven configuration. (default: global-settings)
210     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
211     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
212         Must not include a "-f" option; see parameter mvn-dir.
213     :mvn-version: Version of maven to use. (default: mvn35)
214     :stream: Keyword that represents a release code-name.
215         Often the same as the branch. (default: master)
216     :submodule-recursive: Whether to checkout submodules recursively.
217         (default: true)
218     :submodule-timeout: Timeout (in minutes) for checkout operation.
219         (default: 10)
220     :submodule-disable: Disable submodule checkout operation.
221         (default: false)
222
223     :gerrit_merge_triggers: Override Gerrit Triggers.
224
225 Maven JavaDoc Verify
226 --------------------
227
228 Produces javadocs for a Maven project.
229
230 Expects javadocs to be available in ``$WORKSPACE/target/site/apidocs``, but
231 overrideable with the ``mvn-dir`` parameter. If set, will search for javadocs
232 in ``$WORKSPACE/{mvn-dir}/target/site/apidocs``.
233
234 :Template Names:
235
236     - {project-name}-maven-javadoc-verify-{stream}-{java-version}
237     - gerrit-maven-javadoc-verify
238     - github-maven-javadoc-verify
239
240 :Comment Trigger: recheck|reverify
241
242 :Required parameters:
243     :build-node:    The node to run build on.
244     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
245     :mvn-settings: The name of settings file containing credentials for the project.
246
247 :Optional parameters:
248
249     :branch: The branch to build against. (default: master)
250     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
251     :build-timeout: Timeout in minutes before aborting build. (default: 60)
252     :deploy-path:    The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
253     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
254     :java-version: Version of Java to use for the build. (default: openjdk11)
255     :mvn-dir: Directory supplied as argument to -f option (default: '.')
256     :mvn-global-settings: The name of the Maven global settings to use for
257         Maven configuration. (default: global-settings)
258     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
259     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
260         Must not include a "-f" option; see parameter mvn-dir.
261     :mvn-version: Version of maven to use. (default: mvn35)
262     :stream: Keyword that represents a release code-name.
263         Often the same as the branch. (default: master)
264     :submodule-recursive: Whether to checkout submodules recursively.
265         (default: true)
266     :submodule-timeout: Timeout (in minutes) for checkout operation.
267         (default: 10)
268     :submodule-disable: Disable submodule checkout operation.
269         (default: false)
270
271     :gerrit_verify_triggers: Override Gerrit Triggers.
272
273 Maven Merge
274 -----------
275
276 Merge job which runs `mvn clean deploy` to build a project.
277
278 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
279 goal to push the upload. This is to get around the issue that Maven deploy does
280 not properly support uploading files at the end of the build and instead pushes
281 as it goes. There exists a ``-Ddeploy-at-end`` feature but it does not work
282 with extensions.
283
284 This job uses the following strategy to deploy jobs to Nexus:
285
286 1. ``wget -r`` to fetch maven-metadata.xml from Nexus
287 2. ``mvn deploy -DaltDeploymentRepository`` to prepare files for upload
288 3. Removes untouched maven-metadata.xml files before upload
289 4. Use lftools (cURL) upload script to push artifacts to Nexus
290
291 :Template Names:
292
293     - {project-name}-maven-merge-{stream}
294     - gerrit-maven-merge
295     - github-maven-merge
296
297 :Comment Trigger: remerge
298
299 :Required parameters:
300
301     :build-node: The node to run build on.
302     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
303     :mvn-settings: The name of settings file containing credentials for the project.
304     :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
305         (Note: This setting is generally configured in ``defaults.yaml``.)
306     :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
307
308 :Optional parameters:
309
310     :branch: Git branch to fetch for the build. (default: master)
311     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
312     :build-timeout: Timeout in minutes before aborting build. (default: 60)
313     :cron: Cron schedule when to trigger the job. This parameter also
314         supports multiline input via YAML pipe | character in cases where
315         one may want to provide more than 1 cron timer. (default: 'H H * * 0'
316         to run weekly)
317     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
318     :java-version: Version of Java to use for the build. (default: openjdk11)
319     :mvn-global-settings: The name of the Maven global settings to use for
320         Maven configuration. (default: global-settings)
321     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
322     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
323     :mvn-version: Version of maven to use. (default: mvn35)
324     :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
325     :pre-build-script: Shell script to run before maven build. (default: a string with a shell comment)
326     :post-build-script: Shell script to run after maven build. (default: a string with a shell comment)
327     :stream: Keyword that represents a release code-name.
328         Often the same as the branch. (default: master)
329     :submodule-recursive: Whether to checkout submodules recursively.
330         (default: true)
331     :submodule-timeout: Timeout (in minutes) for checkout operation.
332         (default: 10)
333     :submodule-disable: Disable submodule checkout operation.
334         (default: false)
335
336     :gerrit_merge_triggers: Override Gerrit Triggers.
337     :gerrit_trigger_file_paths: Override file paths to filter which file
338         modifications will trigger a build.
339
340 Maven Merge for Docker
341 ----------------------
342
343 Produces a snapshot docker image in a Nexus registry. Appropriate for
344 Java projects that do not need to deploy any POM or JAR files.
345
346 Like the Maven Merge job as described above but logs in to Docker
347 registries first and skips the lf-maven-deploy builder. The project
348 POM file should invoke a plugin to build and push a Docker image.
349 This pulls the base image from the registry in the environment
350 variable ``CONTAINER_PULL_REGISTRY`` and pushes new image into the
351 registry in the environment variable ``CONTAINER_PUSH_REGISTRY``.
352
353 :Template Names:
354
355     - {project-name}-maven-docker-merge-{stream}
356     - gerrit-maven-docker-merge
357     - github-maven-docker-merge
358
359 :Required parameters:
360
361     :container-public-registry: Docker registry source with base images.
362     :container-snapshot-registry: Docker registry target for the deploy action.
363
364 All other required and optional parameters are identical to the Maven Merge job
365 described above.
366
367 Maven Stage
368 -----------
369
370 Produces a release candidate by creating a staging repo in Nexus.
371
372 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
373 "autorelease-2000", "odlparent-1201", etc...
374
375 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
376 directory is then used later to deploy to Nexus.
377
378 :Template Names:
379
380     - {project-name}-maven-stage-{stream}
381     - gerrit-maven-stage
382     - github-maven-stage
383
384 :Comment Trigger: "stage-release" or "stage-maven-release"
385
386 :Required parameters:
387
388     :build-node: The node to run build on.
389     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
390     :mvn-settings: The name of settings file containing credentials for the project.
391     :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
392         (Note: This setting is generally configured in ``defaults.yaml``.)
393     :staging-profile-id: Profile ID of the project's Nexus staging profile.
394
395 :Optional parameters:
396
397     :archive-artifacts: Artifacts to archive to the logs server (default: '').
398     :branch: The branch to build against. (default: master)
399     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
400     :build-timeout: Timeout in minutes before aborting build. (default: 60)
401     :cron: Cron schedule when to trigger the job. This parameter also
402         supports multiline input via YAML pipe | character in cases where
403         one may want to provide more than 1 cron timer. (default: '')
404     :deploy-path:    The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
405     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
406     :java-version: Version of Java to use for the build. (default: openjdk11)
407     :mvn-central: Set to ``true`` to also stage to **OSSRH**. This is for projects
408         that want to release to Maven Central. If set, then also set the parameter
409         ``ossrh-profile-id``. (default: false)
410     :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
411     :mvn-global-settings: The name of the Maven global settings to use for
412         Maven configuration. (default: global-settings)
413     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
414     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
415     :mvn-version: Version of maven to use. (default: mvn35)
416     :ossrh-profile-id: Profile ID for project as provided by OSSRH.
417         (default: '')
418     :sbom-flags: SBOM generator options if using sbom-generator.
419         See https://github.com/opensbom-generator/spdx-sbom-generator
420     :sbom-generator: Calls lf-infra-maven-sbom-generator to run the SPDX SBOM generator tool.
421         (default: false)
422     :sbom-generator-version: SBOM generator version to download and run if using sbom-generator.
423         (default: v0.0.10)
424     :sbom-path: Path where SBOM is going to be executed from.
425         (default: $WORKSPACE)
426     :sign-artifacts: Sign artifacts with Sigul. (default: false)
427     :stream: Keyword that represents a release code-name.
428         Often the same as the branch. (default: master)
429     :submodule-recursive: Whether to checkout submodules recursively.
430         (default: true)
431     :submodule-timeout: Timeout (in minutes) for checkout operation.
432         (default: 10)
433     :submodule-disable: Disable submodule checkout operation.
434         (default: false)
435     :version-properties-file: Name and path of the version properties file.
436         (default: version.properties)
437
438     :gerrit_release_triggers: Override Gerrit Triggers.
439     :gerrit_trigger_file_paths: Override file paths to filter which file
440         modifications will trigger a build.
441
442 Maven Stage for Docker
443 ----------------------
444
445 Produces a release candidate docker image in a Nexus registry.
446 Appropriate for Java projects that do not need to deploy any POM or
447 JAR files.
448
449 Like the Maven Stage job as described above but logs in to Docker
450 registries first and skips the lf-maven-deploy builder. The project
451 POM file should invoke a plugin to build and push a Docker image.
452 This pulls the base image from the registry in the environment
453 variable ``CONTAINER_PULL_REGISTRY`` and pushes new image into the
454 registry in the environment variable ``CONTAINER_PUSH_REGISTRY``.
455
456 :Template Names:
457
458     - {project-name}-maven-docker-stage-{stream}
459     - gerrit-maven-docker-stage
460     - github-maven-docker-stage
461
462 :Comment Trigger: "stage-release" or "stage-docker-release"
463
464 :Required parameters:
465
466     :container-public-registry: Docker registry source with base images.
467     :container-staging-registry: Docker registry target for the deploy action.
468
469 :Optional parameters:
470
471     :gerrit_release_docker_triggers: Override Gerrit Triggers.
472
473 All other required and optional parameters are identical to the Maven Stage job
474 described above.
475
476 .. _maven-sonar:
477
478 Maven Sonar
479 -----------
480
481 Sonar job which runs mvn clean install then publishes to Sonar.
482
483 This job purposely runs on the ``master`` branch and does not support
484 multi-branch configuration.
485
486 :Template Names:
487
488     - {project-name}-sonar
489     - gerrit-maven-sonar
490     - github-maven-sonar
491     - {project-name}-sonar-prescan-script
492     - gerrit-maven-sonar-prescan-script
493     - github-maven-sonar-prescan-script
494
495 :Comment Trigger: run-sonar
496
497 :Required parameters:
498
499     :build-node: The node to run build on.
500     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
501     :mvn-settings: The name of settings file containing credentials for the project.
502     :sonar-prescan-script: (maven-sonar-prescan-script jobs) A shell script to run before
503         sonar scans.
504
505 :Optional parameters:
506
507     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
508     :build-timeout: Timeout in minutes before aborting build. (default: 60)
509     :cron: Cron schedule when to trigger the job. This parameter also
510         supports multiline input via YAML pipe | character in cases where
511         one may want to provide more than 1 cron timer.  (default: 'H H * * 6'
512         to run weekly)
513     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
514     :java-version: Version of Java to use for the Maven build. (default: openjdk11)
515     :mvn-global-settings: The name of the Maven global settings to use for
516         Maven configuration. (default: global-settings)
517     :mvn-goals: The maven goals to perform for the build.
518         (default: clean install)
519     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
520     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
521     :mvn-version: Version of maven to use. (default: mvn35)
522     :sonar-mvn-goals: Maven goals to run for sonar analysis.
523         (default: sonar:sonar)
524     :sonarcloud: Set to ``true`` to use SonarCloud ``true|false``.
525         (default: false)
526     :sonarcloud-project-key: SonarCloud project key. (default: '')
527     :sonarcloud-project-organization: SonarCloud project organization.
528         (default: '')
529     :sonarcloud-api-token: SonarCloud API Token. (default: '')
530     :sonarcloud-java-version: Version of Java to use for the Sonar scan. (default: openjdk11)
531     :stream: Keyword that represents a release code-name.
532         Often the same as the branch. (default: master)
533     :submodule-recursive: Whether to checkout submodules recursively.
534         (default: true)
535     :submodule-timeout: Timeout (in minutes) for checkout operation.
536         (default: 10)
537     :submodule-disable: Disable submodule checkout operation.
538         (default: false)
539     :scan-dev-branch: Run the scan on a developer branch.
540         (default: false)
541
542     :gerrit_sonar_triggers: Override Gerrit Triggers.
543
544
545 SonarCloud Example:
546
547 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
548    :language: yaml
549
550 Maven Sonar Verify
551 ------------------
552
553 Sonar job which runs mvn clean install then publishes to Sonar.
554
555 This job runs on dev branches and its triggered on new patchsets.
556
557 :Template Names:
558
559     - {project-name}-sonar-verify
560     - gerrit-maven-sonar-verify
561
562 :Comment Trigger: recheck|reverify
563
564 :Required parameters:
565
566     :build-node: The node to run build on.
567     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
568     :mvn-settings: The name of settings file containing credentials for the project.
569
570 :Optional parameters:
571
572     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
573     :build-timeout: Timeout in minutes before aborting build. (default: 60)
574     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
575     :java-version: Version of Java to use for the Maven build. (default: openjdk11)
576     :mvn-global-settings: The name of the Maven global settings to use for
577         Maven configuration. (default: global-settings)
578     :mvn-goals: The maven goals to perform for the build.
579         (default: clean install)
580     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
581     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
582     :mvn-version: Version of maven to use. (default: mvn35)
583     :pre-build-script: Shell script to run before maven build. (default: a string with a shell comment)
584     :post-build-script: Shell script to run after maven build. (default: a string with a shell comment)
585     :sonar-mvn-goal: Maven goals to run for sonar analysis.
586         (default: sonar:sonar)
587     :sonarcloud: Set to ``true`` to use SonarCloud ``true|false``.
588         (default: true)
589     :sonarcloud-project-key: SonarCloud project key. (default: '')
590     :sonarcloud-project-organization: SonarCloud project organization.
591         (default: '')
592     :sonarcloud-api-token: SonarCloud API Token. (default: '')
593     :sonarcloud-java-version: Version of Java to use for the Sonar scan. (default: openjdk11)
594     :sonarcloud-qualitygate-wait: SonarCloud flag that forces the analysis step to
595         wait for the quality gate result. (default: false)
596     :stream: Keyword that represents a release code-name.
597         Often the same as the branch. (default: master)
598     :submodule-recursive: Whether to checkout submodules recursively.
599         (default: true)
600     :submodule-timeout: Timeout (in minutes) for checkout operation.
601         (default: 10)
602     :submodule-disable: Disable submodule checkout operation.
603         (default: false)
604     :scan-dev-branch: Run the scan on a developer branch.
605         (default: true)
606
607     :gerrit_sonar_triggers: Override Gerrit Triggers.
608
609
610 SonarCloud Example:
611
612 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
613    :language: yaml
614
615 Maven Verify
616 ------------
617
618 Verify job which runs mvn clean install to test a project build..
619
620 :Template Names:
621
622     - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
623     - gerrit-maven-verify
624     - github-maven-verify
625
626 :Comment Trigger: recheck|reverify
627
628 :Required parameters:
629
630     :build-node: The node to run build on.
631     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
632     :mvn-settings: The name of settings file containing credentials for the project.
633
634 :Optional parameters:
635
636     :branch: Git branch to fetch for the build. (default: master)
637     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
638     :build-timeout: Timeout in minutes before aborting build. (default: 60)
639     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
640     :java-version: Version of Java to use for the build. (default: openjdk11)
641     :mvn-global-settings: The name of the Maven global settings to use for
642         Maven configuration. (default: global-settings)
643     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
644     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
645     :mvn-version: Version of maven to use. (default: mvn35)
646     :stream: Keyword that represents a release code-name.
647         Often the same as the branch. (default: master)
648     :submodule-recursive: Whether to checkout submodules recursively.
649         (default: true)
650     :submodule-timeout: Timeout (in minutes) for checkout operation.
651         (default: 10)
652     :submodule-disable: Disable submodule checkout operation.
653         (default: false)
654
655     :gerrit_verify_triggers: Override Gerrit Triggers.
656     :gerrit_trigger_file_paths: Override file paths to filter which file
657         modifications will trigger a build.
658
659 Maven Verify for Docker
660 -----------------------
661
662 Like the Maven Verify job as described above but logs in to Docker
663 registries first. The project POM file should invoke a plugin to build
664 a Docker image. This pulls the base image from the registry in the environment
665 variable ``CONTAINER_PULL_REGISTRY``.
666
667 :Template Names:
668
669     - {project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}
670     - gerrit-maven-docker-verify
671     - github-maven-docker-verify
672
673 :Required parameters:
674
675     :container-public-registry: Docker registry source with base images.
676
677 All other required and optional parameters are identical to the Maven Verify job
678 described above.
679
680 Maven Verify w/ Dependencies
681 ----------------------------
682
683 Verify job which runs mvn clean install to test a project build /w deps
684
685 This job's purpose is to verify a patch in conjunction to a list of upstream
686 patches it depends on. The user of this job can provide a list of patches via
687 comment trigger.
688
689 :Template Names:
690
691     - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
692     - gerrit-maven-verify-dependencies
693
694 :Comment Trigger: recheck: SPACE_SEPARATED_LIST_OF_PATCHES
695
696 :Required parameters:
697
698     :build-node: The node to run build on.
699     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
700     :mvn-settings: The name of settings file containing credentials for the project.
701
702 :Optional parameters:
703
704     :branch: Git branch to fetch for the build. (default: master)
705     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
706     :build-timeout: Timeout in minutes before aborting build. (default: 60)
707     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
708     :java-version: Version of Java to use for the build. (default: openjdk11)
709     :mvn-global-settings: The name of the Maven global settings to use for
710         Maven configuration. (default: global-settings)
711     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
712     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
713     :mvn-version: Version of maven to use. (default: mvn35)
714     :stream: Keyword that represents a release code-name.
715         Often the same as the branch. (default: master)
716     :submodule-recursive: Whether to checkout submodules recursively.
717         (default: true)
718     :submodule-timeout: Timeout (in minutes) for checkout operation.
719         (default: 10)
720     :submodule-disable: Disable submodule checkout operation.
721         (default: false)
722
723     :gerrit_verify_triggers: Override Gerrit Triggers.
724     :gerrit_trigger_file_paths: Override file paths to filter which file
725         modifications will trigger a build.