Merge "Fix: Isolate SBOM PATH flag"
[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     :stream: Keyword that represents a release code-name.
326         Often the same as the branch. (default: master)
327     :submodule-recursive: Whether to checkout submodules recursively.
328         (default: true)
329     :submodule-timeout: Timeout (in minutes) for checkout operation.
330         (default: 10)
331     :submodule-disable: Disable submodule checkout operation.
332         (default: false)
333
334     :gerrit_merge_triggers: Override Gerrit Triggers.
335     :gerrit_trigger_file_paths: Override file paths to filter which file
336         modifications will trigger a build.
337
338 Maven Merge for Docker
339 ----------------------
340
341 Produces a snapshot docker image in a Nexus registry. Appropriate for
342 Java projects that do not need to deploy any POM or JAR files.
343
344 Like the Maven Merge job as described above but logs in to Docker
345 registries first and skips the lf-maven-deploy builder. The project
346 POM file should invoke a plugin to build and push a Docker image.
347 This pulls the base image from the registry in the environment
348 variable ``CONTAINER_PULL_REGISTRY`` and pushes new image into the
349 registry in the environment variable ``CONTAINER_PUSH_REGISTRY``.
350
351 :Template Names:
352
353     - {project-name}-maven-docker-merge-{stream}
354     - gerrit-maven-docker-merge
355     - github-maven-docker-merge
356
357 :Required parameters:
358
359     :container-public-registry: Docker registry source with base images.
360     :container-snapshot-registry: Docker registry target for the deploy action.
361
362 All other required and optional parameters are identical to the Maven Merge job
363 described above.
364
365 Maven Stage
366 -----------
367
368 Produces a release candidate by creating a staging repo in Nexus.
369
370 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
371 "autorelease-2000", "odlparent-1201", etc...
372
373 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
374 directory is then used later to deploy to Nexus.
375
376 :Template Names:
377
378     - {project-name}-maven-stage-{stream}
379     - gerrit-maven-stage
380     - github-maven-stage
381
382 :Comment Trigger: "stage-release" or "stage-maven-release"
383
384 :Required parameters:
385
386     :build-node: The node to run build on.
387     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
388     :mvn-settings: The name of settings file containing credentials for the project.
389     :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
390         (Note: This setting is generally configured in ``defaults.yaml``.)
391     :staging-profile-id: Profile ID of the project's Nexus staging profile.
392
393 :Optional parameters:
394
395     :archive-artifacts: Artifacts to archive to the logs server (default: '').
396     :branch: The branch to build against. (default: master)
397     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
398     :build-timeout: Timeout in minutes before aborting build. (default: 60)
399     :cron: Cron schedule when to trigger the job. This parameter also
400         supports multiline input via YAML pipe | character in cases where
401         one may want to provide more than 1 cron timer. (default: '')
402     :deploy-path:    The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
403     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
404     :java-version: Version of Java to use for the build. (default: openjdk11)
405     :mvn-central: Set to ``true`` to also stage to **OSSRH**. This is for projects
406         that want to release to Maven Central. If set, then also set the parameter
407         ``ossrh-profile-id``. (default: false)
408     :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
409     :mvn-global-settings: The name of the Maven global settings to use for
410         Maven configuration. (default: global-settings)
411     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
412     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
413     :mvn-version: Version of maven to use. (default: mvn35)
414     :ossrh-profile-id: Profile ID for project as provided by OSSRH.
415         (default: '')
416     :sbom-flags: SBOM generator options if using sbom-generator.
417         See https://github.com/opensbom-generator/spdx-sbom-generator
418     :sbom-generator: Calls lf-infra-maven-sbom-generator to run the SPDX SBOM generator tool.
419         (default: false)
420     :sbom-generator-version: SBOM generator version to download and run if using sbom-generator.
421         (default: v0.0.10)
422     :sbom-path: Path where SBOM is going to be executed from.
423         (default: $WORKSPACE)
424     :sign-artifacts: Sign artifacts with Sigul. (default: false)
425     :stream: Keyword that represents a release code-name.
426         Often the same as the branch. (default: master)
427     :submodule-recursive: Whether to checkout submodules recursively.
428         (default: true)
429     :submodule-timeout: Timeout (in minutes) for checkout operation.
430         (default: 10)
431     :submodule-disable: Disable submodule checkout operation.
432         (default: false)
433     :version-properties-file: Name and path of the version properties file.
434         (default: version.properties)
435
436     :gerrit_release_triggers: Override Gerrit Triggers.
437     :gerrit_trigger_file_paths: Override file paths to filter which file
438         modifications will trigger a build.
439
440 Maven Stage for Docker
441 ----------------------
442
443 Produces a release candidate docker image in a Nexus registry.
444 Appropriate for Java projects that do not need to deploy any POM or
445 JAR files.
446
447 Like the Maven Stage job as described above but logs in to Docker
448 registries first and skips the lf-maven-deploy builder. The project
449 POM file should invoke a plugin to build and push a Docker image.
450 This pulls the base image from the registry in the environment
451 variable ``CONTAINER_PULL_REGISTRY`` and pushes new image into the
452 registry in the environment variable ``CONTAINER_PUSH_REGISTRY``.
453
454 :Template Names:
455
456     - {project-name}-maven-docker-stage-{stream}
457     - gerrit-maven-docker-stage
458     - github-maven-docker-stage
459
460 :Comment Trigger: "stage-release" or "stage-docker-release"
461
462 :Required parameters:
463
464     :container-public-registry: Docker registry source with base images.
465     :container-staging-registry: Docker registry target for the deploy action.
466
467 :Optional parameters:
468
469     :gerrit_release_docker_triggers: Override Gerrit Triggers.
470
471 All other required and optional parameters are identical to the Maven Stage job
472 described above.
473
474 .. _maven-sonar:
475
476 Maven Sonar
477 -----------
478
479 Sonar job which runs mvn clean install then publishes to Sonar.
480
481 This job purposely runs on the ``master`` branch and does not support
482 multi-branch configuration.
483
484 :Template Names:
485
486     - {project-name}-sonar
487     - gerrit-maven-sonar
488     - github-maven-sonar
489     - {project-name}-sonar-prescan-script
490     - gerrit-maven-sonar-prescan-script
491     - github-maven-sonar-prescan-script
492
493 :Comment Trigger: run-sonar
494
495 :Required parameters:
496
497     :build-node: The node to run build on.
498     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
499     :mvn-settings: The name of settings file containing credentials for the project.
500     :sonar-prescan-script: (maven-sonar-prescan-script jobs) A shell script to run before
501         sonar scans.
502
503 :Optional parameters:
504
505     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
506     :build-timeout: Timeout in minutes before aborting build. (default: 60)
507     :cron: Cron schedule when to trigger the job. This parameter also
508         supports multiline input via YAML pipe | character in cases where
509         one may want to provide more than 1 cron timer.  (default: 'H H * * 6'
510         to run weekly)
511     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
512     :java-version: Version of Java to use for the Maven build. (default: openjdk11)
513     :mvn-global-settings: The name of the Maven global settings to use for
514         Maven configuration. (default: global-settings)
515     :mvn-goals: The maven goals to perform for the build.
516         (default: clean install)
517     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
518     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
519     :mvn-version: Version of maven to use. (default: mvn35)
520     :sonar-mvn-goals: Maven goals to run for sonar analysis.
521         (default: sonar:sonar)
522     :sonarcloud: Set to ``true`` to use SonarCloud ``true|false``.
523         (default: false)
524     :sonarcloud-project-key: SonarCloud project key. (default: '')
525     :sonarcloud-project-organization: SonarCloud project organization.
526         (default: '')
527     :sonarcloud-api-token: SonarCloud API Token. (default: '')
528     :sonarcloud-java-version: Version of Java to use for the Sonar scan. (default: openjdk11)
529     :stream: Keyword that represents a release code-name.
530         Often the same as the branch. (default: master)
531     :submodule-recursive: Whether to checkout submodules recursively.
532         (default: true)
533     :submodule-timeout: Timeout (in minutes) for checkout operation.
534         (default: 10)
535     :submodule-disable: Disable submodule checkout operation.
536         (default: false)
537     :scan-dev-branch: Run the scan on a developer branch.
538         (default: false)
539
540     :gerrit_sonar_triggers: Override Gerrit Triggers.
541
542
543 SonarCloud Example:
544
545 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
546    :language: yaml
547
548 Maven Sonar Verify
549 ------------------
550
551 Sonar job which runs mvn clean install then publishes to Sonar.
552
553 This job runs on dev branches and its triggered on new patchsets.
554
555 :Template Names:
556
557     - {project-name}-sonar-verify
558     - gerrit-maven-sonar-verify
559
560 :Comment Trigger: recheck|reverify
561
562 :Required parameters:
563
564     :build-node: The node to run build on.
565     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
566     :mvn-settings: The name of settings file containing credentials for the project.
567
568 :Optional parameters:
569
570     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
571     :build-timeout: Timeout in minutes before aborting build. (default: 60)
572     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
573     :java-version: Version of Java to use for the Maven build. (default: openjdk11)
574     :mvn-global-settings: The name of the Maven global settings to use for
575         Maven configuration. (default: global-settings)
576     :mvn-goals: The maven goals to perform for the build.
577         (default: clean install)
578     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
579     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
580     :mvn-version: Version of maven to use. (default: mvn35)
581     :sonar-mvn-goal: Maven goals to run for sonar analysis.
582         (default: sonar:sonar)
583     :sonarcloud: Set to ``true`` to use SonarCloud ``true|false``.
584         (default: true)
585     :sonarcloud-project-key: SonarCloud project key. (default: '')
586     :sonarcloud-project-organization: SonarCloud project organization.
587         (default: '')
588     :sonarcloud-api-token: SonarCloud API Token. (default: '')
589     :sonarcloud-java-version: Version of Java to use for the Sonar scan. (default: openjdk11)
590     :sonarcloud-qualitygate-wait: SonarCloud flag that forces the analysis step to
591         wait for the quality gate result. (default: false)
592     :stream: Keyword that represents a release code-name.
593         Often the same as the branch. (default: master)
594     :submodule-recursive: Whether to checkout submodules recursively.
595         (default: true)
596     :submodule-timeout: Timeout (in minutes) for checkout operation.
597         (default: 10)
598     :submodule-disable: Disable submodule checkout operation.
599         (default: false)
600     :scan-dev-branch: Run the scan on a developer branch.
601         (default: true)
602
603     :gerrit_sonar_triggers: Override Gerrit Triggers.
604
605
606 SonarCloud Example:
607
608 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
609    :language: yaml
610
611 Maven Verify
612 ------------
613
614 Verify job which runs mvn clean install to test a project build..
615
616 :Template Names:
617
618     - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
619     - gerrit-maven-verify
620     - github-maven-verify
621
622 :Comment Trigger: recheck|reverify
623
624 :Required parameters:
625
626     :build-node: The node to run build on.
627     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
628     :mvn-settings: The name of settings file containing credentials for the project.
629
630 :Optional parameters:
631
632     :branch: Git branch to fetch for the build. (default: master)
633     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
634     :build-timeout: Timeout in minutes before aborting build. (default: 60)
635     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
636     :java-version: Version of Java to use for the build. (default: openjdk11)
637     :mvn-global-settings: The name of the Maven global settings to use for
638         Maven configuration. (default: global-settings)
639     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
640     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
641     :mvn-version: Version of maven to use. (default: mvn35)
642     :stream: Keyword that represents a release code-name.
643         Often the same as the branch. (default: master)
644     :submodule-recursive: Whether to checkout submodules recursively.
645         (default: true)
646     :submodule-timeout: Timeout (in minutes) for checkout operation.
647         (default: 10)
648     :submodule-disable: Disable submodule checkout operation.
649         (default: false)
650
651     :gerrit_verify_triggers: Override Gerrit Triggers.
652     :gerrit_trigger_file_paths: Override file paths to filter which file
653         modifications will trigger a build.
654
655 Maven Verify for Docker
656 -----------------------
657
658 Like the Maven Verify job as described above but logs in to Docker
659 registries first. The project POM file should invoke a plugin to build
660 a Docker image. This pulls the base image from the registry in the environment
661 variable ``CONTAINER_PULL_REGISTRY``.
662
663 :Template Names:
664
665     - {project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}
666     - gerrit-maven-docker-verify
667     - github-maven-docker-verify
668
669 :Required parameters:
670
671     :container-public-registry: Docker registry source with base images.
672
673 All other required and optional parameters are identical to the Maven Verify job
674 described above.
675
676 Maven Verify w/ Dependencies
677 ----------------------------
678
679 Verify job which runs mvn clean install to test a project build /w deps
680
681 This job's purpose is to verify a patch in conjunction to a list of upstream
682 patches it depends on. The user of this job can provide a list of patches via
683 comment trigger.
684
685 :Template Names:
686
687     - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
688     - gerrit-maven-verify-dependencies
689
690 :Comment Trigger: recheck: SPACE_SEPARATED_LIST_OF_PATCHES
691
692 :Required parameters:
693
694     :build-node: The node to run build on.
695     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
696     :mvn-settings: The name of settings file containing credentials for the project.
697
698 :Optional parameters:
699
700     :branch: Git branch to fetch for the build. (default: master)
701     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
702     :build-timeout: Timeout in minutes before aborting build. (default: 60)
703     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
704     :java-version: Version of Java to use for the build. (default: openjdk11)
705     :mvn-global-settings: The name of the Maven global settings to use for
706         Maven configuration. (default: global-settings)
707     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
708     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
709     :mvn-version: Version of maven to use. (default: mvn35)
710     :stream: Keyword that represents a release code-name.
711         Often the same as the branch. (default: master)
712     :submodule-recursive: Whether to checkout submodules recursively.
713         (default: true)
714     :submodule-timeout: Timeout (in minutes) for checkout operation.
715         (default: 10)
716     :submodule-disable: Disable submodule checkout operation.
717         (default: false)
718
719     :gerrit_verify_triggers: Override Gerrit Triggers.
720     :gerrit_trigger_file_paths: Override file paths to filter which file
721         modifications will trigger a build.