411a712642ad7d8838421268e314c0cf267fe64e
[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     :sign-artifacts: Sign artifacts with Sigul. (default: false)
423     :stream: Keyword that represents a release code-name.
424         Often the same as the branch. (default: master)
425     :submodule-recursive: Whether to checkout submodules recursively.
426         (default: true)
427     :submodule-timeout: Timeout (in minutes) for checkout operation.
428         (default: 10)
429     :submodule-disable: Disable submodule checkout operation.
430         (default: false)
431     :version-properties-file: Name and path of the version properties file.
432         (default: version.properties)
433
434     :gerrit_release_triggers: Override Gerrit Triggers.
435     :gerrit_trigger_file_paths: Override file paths to filter which file
436         modifications will trigger a build.
437
438 Maven Stage for Docker
439 ----------------------
440
441 Produces a release candidate docker image in a Nexus registry.
442 Appropriate for Java projects that do not need to deploy any POM or
443 JAR files.
444
445 Like the Maven Stage job as described above but logs in to Docker
446 registries first and skips the lf-maven-deploy builder. The project
447 POM file should invoke a plugin to build and push a Docker image.
448 This pulls the base image from the registry in the environment
449 variable ``CONTAINER_PULL_REGISTRY`` and pushes new image into the
450 registry in the environment variable ``CONTAINER_PUSH_REGISTRY``.
451
452 :Template Names:
453
454     - {project-name}-maven-docker-stage-{stream}
455     - gerrit-maven-docker-stage
456     - github-maven-docker-stage
457
458 :Comment Trigger: "stage-release" or "stage-docker-release"
459
460 :Required parameters:
461
462     :container-public-registry: Docker registry source with base images.
463     :container-staging-registry: Docker registry target for the deploy action.
464
465 :Optional parameters:
466
467     :gerrit_release_docker_triggers: Override Gerrit Triggers.
468
469 All other required and optional parameters are identical to the Maven Stage job
470 described above.
471
472 .. _maven-sonar:
473
474 Maven Sonar
475 -----------
476
477 Sonar job which runs mvn clean install then publishes to Sonar.
478
479 This job purposely runs on the ``master`` branch and does not support
480 multi-branch configuration.
481
482 :Template Names:
483
484     - {project-name}-sonar
485     - gerrit-maven-sonar
486     - github-maven-sonar
487     - {project-name}-sonar-prescan-script
488     - gerrit-maven-sonar-prescan-script
489     - github-maven-sonar-prescan-script
490
491 :Comment Trigger: run-sonar
492
493 :Required parameters:
494
495     :build-node: The node to run build on.
496     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
497     :mvn-settings: The name of settings file containing credentials for the project.
498     :sonar-prescan-script: (maven-sonar-prescan-script jobs) A shell script to run before
499         sonar scans.
500
501 :Optional parameters:
502
503     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
504     :build-timeout: Timeout in minutes before aborting build. (default: 60)
505     :cron: Cron schedule when to trigger the job. This parameter also
506         supports multiline input via YAML pipe | character in cases where
507         one may want to provide more than 1 cron timer.  (default: 'H H * * 6'
508         to run weekly)
509     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
510     :java-version: Version of Java to use for the Maven build. (default: openjdk11)
511     :mvn-global-settings: The name of the Maven global settings to use for
512         Maven configuration. (default: global-settings)
513     :mvn-goals: The maven goals to perform for the build.
514         (default: clean install)
515     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
516     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
517     :mvn-version: Version of maven to use. (default: mvn35)
518     :sonar-mvn-goals: Maven goals to run for sonar analysis.
519         (default: sonar:sonar)
520     :sonarcloud: Set to ``true`` to use SonarCloud ``true|false``.
521         (default: false)
522     :sonarcloud-project-key: SonarCloud project key. (default: '')
523     :sonarcloud-project-organization: SonarCloud project organization.
524         (default: '')
525     :sonarcloud-api-token: SonarCloud API Token. (default: '')
526     :sonarcloud-java-version: Version of Java to use for the Sonar scan. (default: openjdk11)
527     :stream: Keyword that represents a release code-name.
528         Often the same as the branch. (default: master)
529     :submodule-recursive: Whether to checkout submodules recursively.
530         (default: true)
531     :submodule-timeout: Timeout (in minutes) for checkout operation.
532         (default: 10)
533     :submodule-disable: Disable submodule checkout operation.
534         (default: false)
535     :scan-dev-branch: Run the scan on a developer branch.
536         (default: false)
537
538     :gerrit_sonar_triggers: Override Gerrit Triggers.
539
540
541 SonarCloud Example:
542
543 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
544    :language: yaml
545
546 Maven Sonar Verify
547 ------------------
548
549 Sonar job which runs mvn clean install then publishes to Sonar.
550
551 This job runs on dev branches and its triggered on new patchsets.
552
553 :Template Names:
554
555     - {project-name}-sonar-verify
556     - gerrit-maven-sonar-verify
557
558 :Comment Trigger: recheck|reverify
559
560 :Required parameters:
561
562     :build-node: The node to run build on.
563     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
564     :mvn-settings: The name of settings file containing credentials for the project.
565
566 :Optional parameters:
567
568     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
569     :build-timeout: Timeout in minutes before aborting build. (default: 60)
570     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
571     :java-version: Version of Java to use for the Maven build. (default: openjdk11)
572     :mvn-global-settings: The name of the Maven global settings to use for
573         Maven configuration. (default: global-settings)
574     :mvn-goals: The maven goals to perform for the build.
575         (default: clean install)
576     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
577     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
578     :mvn-version: Version of maven to use. (default: mvn35)
579     :sonar-mvn-goal: Maven goals to run for sonar analysis.
580         (default: sonar:sonar)
581     :sonarcloud: Set to ``true`` to use SonarCloud ``true|false``.
582         (default: true)
583     :sonarcloud-project-key: SonarCloud project key. (default: '')
584     :sonarcloud-project-organization: SonarCloud project organization.
585         (default: '')
586     :sonarcloud-api-token: SonarCloud API Token. (default: '')
587     :sonarcloud-java-version: Version of Java to use for the Sonar scan. (default: openjdk11)
588     :sonarcloud-qualitygate-wait: SonarCloud flag that forces the analysis step to
589         wait for the quality gate result. (default: false)
590     :stream: Keyword that represents a release code-name.
591         Often the same as the branch. (default: master)
592     :submodule-recursive: Whether to checkout submodules recursively.
593         (default: true)
594     :submodule-timeout: Timeout (in minutes) for checkout operation.
595         (default: 10)
596     :submodule-disable: Disable submodule checkout operation.
597         (default: false)
598     :scan-dev-branch: Run the scan on a developer branch.
599         (default: true)
600
601     :gerrit_sonar_triggers: Override Gerrit Triggers.
602
603
604 SonarCloud Example:
605
606 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
607    :language: yaml
608
609 Maven Verify
610 ------------
611
612 Verify job which runs mvn clean install to test a project build..
613
614 :Template Names:
615
616     - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
617     - gerrit-maven-verify
618     - github-maven-verify
619
620 :Comment Trigger: recheck|reverify
621
622 :Required parameters:
623
624     :build-node: The node to run build on.
625     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
626     :mvn-settings: The name of settings file containing credentials for the project.
627
628 :Optional parameters:
629
630     :branch: Git branch to fetch for the build. (default: master)
631     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
632     :build-timeout: Timeout in minutes before aborting build. (default: 60)
633     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
634     :java-version: Version of Java to use for the build. (default: openjdk11)
635     :mvn-global-settings: The name of the Maven global settings to use for
636         Maven configuration. (default: global-settings)
637     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
638     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
639     :mvn-version: Version of maven to use. (default: mvn35)
640     :stream: Keyword that represents a release code-name.
641         Often the same as the branch. (default: master)
642     :submodule-recursive: Whether to checkout submodules recursively.
643         (default: true)
644     :submodule-timeout: Timeout (in minutes) for checkout operation.
645         (default: 10)
646     :submodule-disable: Disable submodule checkout operation.
647         (default: false)
648
649     :gerrit_verify_triggers: Override Gerrit Triggers.
650     :gerrit_trigger_file_paths: Override file paths to filter which file
651         modifications will trigger a build.
652
653 Maven Verify for Docker
654 -----------------------
655
656 Like the Maven Verify job as described above but logs in to Docker
657 registries first. The project POM file should invoke a plugin to build
658 a Docker image. This pulls the base image from the registry in the environment
659 variable ``CONTAINER_PULL_REGISTRY``.
660
661 :Template Names:
662
663     - {project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}
664     - gerrit-maven-docker-verify
665     - github-maven-docker-verify
666
667 :Required parameters:
668
669     :container-public-registry: Docker registry source with base images.
670
671 All other required and optional parameters are identical to the Maven Verify job
672 described above.
673
674 Maven Verify w/ Dependencies
675 ----------------------------
676
677 Verify job which runs mvn clean install to test a project build /w deps
678
679 This job's purpose is to verify a patch in conjunction to a list of upstream
680 patches it depends on. The user of this job can provide a list of patches via
681 comment trigger.
682
683 :Template Names:
684
685     - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
686     - gerrit-maven-verify-dependencies
687
688 :Comment Trigger: recheck: SPACE_SEPARATED_LIST_OF_PATCHES
689
690 :Required parameters:
691
692     :build-node: The node to run build on.
693     :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
694     :mvn-settings: The name of settings file containing credentials for the project.
695
696 :Optional parameters:
697
698     :branch: Git branch to fetch for the build. (default: master)
699     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
700     :build-timeout: Timeout in minutes before aborting build. (default: 60)
701     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
702     :java-version: Version of Java to use for the build. (default: openjdk11)
703     :mvn-global-settings: The name of the Maven global settings to use for
704         Maven configuration. (default: global-settings)
705     :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
706     :mvn-params: Parameters to pass to the mvn CLI. (default: '')
707     :mvn-version: Version of maven to use. (default: mvn35)
708     :stream: Keyword that represents a release code-name.
709         Often the same as the branch. (default: master)
710     :submodule-recursive: Whether to checkout submodules recursively.
711         (default: true)
712     :submodule-timeout: Timeout (in minutes) for checkout operation.
713         (default: 10)
714     :submodule-disable: Disable submodule checkout operation.
715         (default: false)
716
717     :gerrit_verify_triggers: Override Gerrit Triggers.
718     :gerrit_trigger_file_paths: Override file paths to filter which file
719         modifications will trigger a build.