8 .. include:: ../job-groups.rst
10 Below is a list of Maven job groups:
12 .. literalinclude:: ../../jjb/lf-maven-job-groups.yaml
22 Runs Sonar against a Maven project.
26 :java-version: Version of Java to execute Sonar with.
27 :mvn-version: Version of Maven to execute Sonar with.
28 :mvn-settings: Maven settings.xml file containing credentials to use.
30 lf-infra-maven-sonarcloud
31 -------------------------
33 Runs Sonar against a Maven project and pushes results to SonarCloud.
37 :java-version: Version of Java to execute Sonar with.
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.
47 Calls the maven build script to perform a maven build.
51 :mvn-goals: The maven goals to perform for the build.
52 (default: clean deploy)
57 Common Jenkins configuration for Maven jobs.
62 Calls the maven deploy script to push artifacts to Nexus.
64 lf-maven-versions-plugin
65 ------------------------
67 Conditionally calls Maven versions plugin to set, update and commit the maven `versions:set`.
71 :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
72 :mvn-version: Version of Maven to execute Sonar with.
73 :mvn-pom: Location of pom.xml.
74 :mvn-settings: Maven settings.xml file containing credentials to use.
79 Calls the maven stage script to push artifacts to a Nexus staging repository.
83 :mvn-global-settings: The name of the Maven global settings to use for
85 :mvn-settings: The name of settings file containing credentials for the project.
87 lf-update-java-alternatives
88 ---------------------------
90 Setup Java alternatives for the Distro.
94 :java-version: Version of Java to set as the default Java.
103 Produces a CLM scan of the code into Nexus IQ Server.
107 - {project-name}-maven-clm-{stream}
111 :Comment Trigger: run-clm
113 :Required parameters:
115 :build-node: The node to run build on.
116 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
117 be configured in defaults.yaml)
118 :mvn-settings: The name of settings file containing credentials for the project.
120 :Optional parameters:
122 :branch: The branch to build against. (default: master)
123 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
124 :build-timeout: Timeout in minutes before aborting build. (default: 60)
125 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
126 :java-version: Version of Java to use for the build. (default: openjdk8)
127 :mvn-global-settings: The name of the Maven global settings to use for
128 Maven configuration. (default: global-settings)
129 :mvn-opts: Sets MAVEN_OPTS. (default: '')
130 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
131 :mvn-version: Version of maven to use. (default: mvn35)
132 :nexus-iq-namespace: Insert a namespace to project AppID for projects that
133 share a Nexus IQ system to avoid project name collision. We recommend
134 inserting a trailing - dash if using this parameter.
135 For example 'odl-'. (default: '')
136 :nexus-iq-stage: Stage the policy evaluation will be run against on
137 the Nexus IQ Server. (default: 'build')
138 :stream: Keyword that can be used to represent a release code-name.
139 Often the same as the branch. (default: master)
140 :submodule-recursive: Whether to checkout submodules recursively.
142 :submodule-timeout: Timeout (in minutes) for checkout operation.
144 :submodule-disable: Disable submodule checkout operation.
147 :gerrit_merge_triggers: Override Gerrit Triggers.
149 Maven JavaDoc Publish
150 ---------------------
152 Produces and publishes javadocs for a Maven project.
154 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
158 - {project-name}-maven-javadoc-publish-{stream}-{java-version}
159 - gerrit-maven-javadoc-publish
160 - github-maven-javadoc-publish
162 :Comment Trigger: remerge
164 :Required parameters:
166 :build-node: The node to run build on.
167 :javadoc-path: The path in Nexus to deploy javadoc to.
168 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
169 be configured in defaults.yaml)
170 :mvn-settings: The name of settings file containing credentials for the project.
171 :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
172 (Note: This setting should be configured in defaults.yaml.)
174 :Optional parameters:
176 :branch: The branch to build against. (default: master)
177 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
178 :build-timeout: Timeout in minutes before aborting build. (default: 60)
179 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
180 :java-version: Version of Java to use for the build. (default: openjdk8)
181 :mvn-global-settings: The name of the Maven global settings to use for
182 Maven configuration. (default: global-settings)
183 :mvn-opts: Sets MAVEN_OPTS. (default: '')
184 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
185 :mvn-version: Version of maven to use. (default: mvn35)
186 :stream: Keyword that can be used to represent a release code-name.
187 Often the same as the branch. (default: master)
188 :submodule-recursive: Whether to checkout submodules recursively.
190 :submodule-timeout: Timeout (in minutes) for checkout operation.
192 :submodule-disable: Disable submodule checkout operation.
195 :gerrit_merge_triggers: Override Gerrit Triggers.
200 Produces javadocs for a Maven project.
202 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
206 - {project-name}-maven-javadoc-verify-{stream}-{java-version}
207 - gerrit-maven-javadoc-verify
208 - github-maven-javadoc-verify
210 :Comment Trigger: recheck|reverify
212 :Required parameters:
213 :build-node: The node to run build on.
214 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
215 be configured in defaults.yaml)
216 :mvn-settings: The name of settings file containing credentials for the project.
218 :Optional parameters:
220 :branch: The branch to build against. (default: master)
221 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
222 :build-timeout: Timeout in minutes before aborting build. (default: 60)
223 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
224 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
225 :java-version: Version of Java to use for the build. (default: openjdk8)
226 :mvn-global-settings: The name of the Maven global settings to use for
227 Maven configuration. (default: global-settings)
228 :mvn-opts: Sets MAVEN_OPTS. (default: '')
229 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
230 :mvn-version: Version of maven to use. (default: mvn35)
231 :stream: Keyword that can be used to represent a release code-name.
232 Often the same as the branch. (default: master)
233 :submodule-recursive: Whether to checkout submodules recursively.
235 :submodule-timeout: Timeout (in minutes) for checkout operation.
237 :submodule-disable: Disable submodule checkout operation.
240 :gerrit_verify_triggers: Override Gerrit Triggers.
245 Merge job which runs `mvn clean deploy` to build a project.
247 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
248 goal to push the upload. This is to get around the issue that Maven deploy does
249 not properly support uploading files at the end of the build and instead pushes
250 as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
253 This job uses the following strategy to deploy jobs to Nexus:
255 1. `wget -r` to fetch maven-metadata.xml from Nexus
256 2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
257 3. Removes untouched maven-metadata.xml files before upload
258 4. Use lftools (cURL) upload script to push artifacts to Nexus
262 - {project-name}-maven-merge-{stream}
266 :Comment Trigger: remerge
268 :Required parameters:
270 :build-node: The node to run build on.
271 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
272 be configured in defaults.yaml)
273 :mvn-settings: The name of settings file containing credentials for the project.
274 :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
275 (Note: This setting should be configured in defaults.yaml.)
276 :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
278 :Optional parameters:
280 :branch: Git branch to fetch for the build. (default: master)
281 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
282 :build-timeout: Timeout in minutes before aborting build. (default: 60)
283 :cron: Cron schedule when to trigger the job. This parameter also
284 supports multiline input via YAML pipe | character in cases where
285 one may want to provide more than 1 cron timer. (default: 'H H * * 0'
287 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
288 :java-version: Version of Java to use for the build. (default: openjdk8)
289 :mvn-global-settings: The name of the Maven global settings to use for
290 Maven configuration. (default: global-settings)
291 :mvn-opts: Sets MAVEN_OPTS. (default: '')
292 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
293 :mvn-version: Version of maven to use. (default: mvn35)
294 :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
295 :stream: Keyword that can be used to represent a release code-name.
296 Often the same as the branch. (default: master)
297 :submodule-recursive: Whether to checkout submodules recursively.
299 :submodule-timeout: Timeout (in minutes) for checkout operation.
301 :submodule-disable: Disable submodule checkout operation.
304 :gerrit_merge_triggers: Override Gerrit Triggers.
305 :gerrit_trigger_file_paths: Override file paths which can be used to
306 filter which file modifications will trigger a build.
308 Maven Merge for Docker
309 ----------------------
311 Produces a snapshot docker image in a Nexus registry. Appropriate for
312 Java projects that do not need to deploy any POM or JAR files.
314 Similar to Maven Merge as described above but logs in to Docker
315 registries first and skips the lf-maven-deploy builder. The project
316 POM file should invoke a plugin to build and push a Docker image. The
317 base image should be pulled from the registry in the environment
318 variable CONTAINER_PULL_REGISTRY. The new image should be pushed to the
319 registry in the environment variable CONTAINER_PUSH_REGISTRY.
323 - {project-name}-maven-docker-merge-{stream}
324 - gerrit-maven-docker-merge
325 - github-maven-docker-merge
327 :Required parameters:
329 :container-public-registry: Docker registry source with base images.
330 :container-snapshot-registry: Docker registry target for the deploy action.
332 All other required and optional parameters are identical to the Maven Merge job
338 Produces a release candidate by creating a staging repo in Nexus.
340 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
341 "autorelease-2000", "odlparent-1201", etc...
343 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
344 directory is then used later to deploy to Nexus.
348 - {project-name}-maven-stage-{stream}
352 :Required parameters:
354 :build-node: The node to run build on.
355 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
356 be configured in defaults.yaml)
357 :mvn-settings: The name of settings file containing credentials for the project.
358 :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
359 (Note: This setting should be configured in defaults.yaml.)
360 :staging-profile-id: Profile ID of the project's Nexus staging profile.
362 :Optional parameters:
364 :archive-artifacts: Artifacts to archive to the logs server (default: '').
365 :branch: The branch to build against. (default: master)
366 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
367 :build-timeout: Timeout in minutes before aborting build. (default: 60)
368 :cron: Cron schedule when to trigger the job. This parameter also
369 supports multiline input via YAML pipe | character in cases where
370 one may want to provide more than 1 cron timer. (default: '')
371 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
372 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
373 :java-version: Version of Java to use for the build. (default: openjdk8)
374 :mvn-central: Set to 'true' to also stage to OSSRH. This is for projects
375 that want to release to Maven Central. If set the parameter
376 ``ossrh-profile-id`` also needs to be set. (default: false)
377 :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
378 :mvn-global-settings: The name of the Maven global settings to use for
379 Maven configuration. (default: global-settings)
380 :mvn-opts: Sets MAVEN_OPTS. (default: '')
381 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
382 :mvn-version: Version of maven to use. (default: mvn35)
383 :ossrh-profile-id: Profile ID for project as provided by OSSRH.
385 :sign-artifacts: Sign artifacts with Sigul. (default: false)
386 :stream: Keyword that can be used to represent a release code-name.
387 Often the same as the branch. (default: master)
388 :submodule-recursive: Whether to checkout submodules recursively.
390 :submodule-timeout: Timeout (in minutes) for checkout operation.
392 :submodule-disable: Disable submodule checkout operation.
395 :gerrit_release_triggers: Override Gerrit Triggers.
396 :gerrit_trigger_file_paths: Override file paths which can be used to
397 filter which file modifications will trigger a build.
399 Maven Stage for Docker
400 ----------------------
402 Produces a release candidate docker image in a Nexus registry.
403 Appropriate for Java projects that do not need to deploy any POM or
406 Similar to Maven Stage as described above but logs in to Docker
407 registries first and skips the lf-maven-deploy builder. The project
408 POM file should invoke a plugin to build and push a Docker image. The
409 base image should be pulled from the registry in the environment
410 variable CONTAINER_PULL_REGISTRY. The new image should be pushed to the
411 registry in the environment variable CONTAINER_PUSH_REGISTRY.
415 - {project-name}-maven-docker-stage-{stream}
416 - gerrit-maven-docker-stage
417 - github-maven-docker-stage
419 :Required parameters:
421 :container-public-registry: Docker registry source with base images.
422 :container-staging-registry: Docker registry target for the deploy action.
424 All other required and optional parameters are identical to the Maven Stage job
432 Sonar job which runs mvn clean install then publishes to Sonar.
434 This job purposely only runs on the master branch as there are Additional
435 configuration needed to support multiple branches and there's not much
436 interest in that kind of support.
440 - {project-name}-sonar
444 :Comment Trigger: run-sonar
446 :Required parameters:
448 :build-node: The node to run build on.
449 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
450 be configured in defaults.yaml)
451 :mvn-settings: The name of settings file containing credentials for the project.
453 :Optional parameters:
455 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
456 :build-timeout: Timeout in minutes before aborting build. (default: 60)
457 :cron: Cron schedule when to trigger the job. This parameter also
458 supports multiline input via YAML pipe | character in cases where
459 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
461 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
462 :java-version: Version of Java to use for the build. (default: openjdk8)
463 :mvn-global-settings: The name of the Maven global settings to use for
464 Maven configuration. (default: global-settings)
465 :mvn-opts: Sets MAVEN_OPTS. (default: '')
466 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
467 :mvn-version: Version of maven to use. (default: mvn35)
468 :sonar-mvn-goals: Maven goals to run for sonar analysis.
469 (default: sonar:sonar)
470 :sonarcloud: Whether or not to use SonarCloud ``true|false``.
472 :sonarcloud-project-key: SonarCloud project key. (default: '')
473 :sonarcloud-project-organization: SonarCloud project organization.
475 :sonarcloud-api-token: SonarCloud API Token. (default: '')
476 :stream: Keyword that can be used to represent a release code-name.
477 Often the same as the branch. (default: master)
478 :submodule-recursive: Whether to checkout submodules recursively.
480 :submodule-timeout: Timeout (in minutes) for checkout operation.
482 :submodule-disable: Disable submodule checkout operation.
485 :gerrit_sonar_triggers: Override Gerrit Triggers.
490 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
496 Verify job which runs mvn clean install to test a project build..
500 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
501 - gerrit-maven-verify
502 - github-maven-verify
504 :Comment Trigger: recheck|reverify
506 :Required parameters:
508 :build-node: The node to run build on.
509 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
510 be configured in defaults.yaml)
511 :mvn-settings: The name of settings file containing credentials for the project.
513 :Optional parameters:
515 :branch: Git branch to fetch for the build. (default: master)
516 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
517 :build-timeout: Timeout in minutes before aborting build. (default: 60)
518 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
519 :java-version: Version of Java to use for the build. (default: openjdk8)
520 :mvn-global-settings: The name of the Maven global settings to use for
521 Maven configuration. (default: global-settings)
522 :mvn-opts: Sets MAVEN_OPTS. (default: '')
523 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
524 :mvn-version: Version of maven to use. (default: mvn35)
525 :stream: Keyword that can be used to represent a release code-name.
526 Often the same as the branch. (default: master)
527 :submodule-recursive: Whether to checkout submodules recursively.
529 :submodule-timeout: Timeout (in minutes) for checkout operation.
531 :submodule-disable: Disable submodule checkout operation.
534 :gerrit_verify_triggers: Override Gerrit Triggers.
535 :gerrit_trigger_file_paths: Override file paths which can be used to
536 filter which file modifications will trigger a build.
538 Maven Verify for Docker
539 -----------------------
541 Similar to Maven Verify as described above but logs in to Docker
542 registries first. The project POM file should invoke a plugin to build
543 a Docker image. The base image should be pulled from the registry in
544 the environment variable CONTAINER_PULL_REGISTRY.
548 - {project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}
549 - gerrit-maven-docker-verify
550 - github-maven-docker-verify
552 :Required parameters:
554 :container-public-registry: Docker registry source with base images.
556 All other required and optional parameters are identical to the Maven Verify job
559 Maven Verify w/ Dependencies
560 ----------------------------
562 Verify job which runs mvn clean install to test a project build /w deps
564 This job can be used to verify a patch in conjunction to all of the
565 upstream patches it depends on. The user of this job can provide a list
570 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
571 - gerrit-maven-verify-dependencies
573 :Comment Trigger: recheck: SPACE_SEPARATED_LIST_OF_PATCHES
575 :Required parameters:
577 :build-node: The node to run build on.
578 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
579 be configured in defaults.yaml)
580 :mvn-settings: The name of settings file containing credentials for the project.
582 :Optional parameters:
584 :branch: Git branch to fetch for the build. (default: master)
585 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
586 :build-timeout: Timeout in minutes before aborting build. (default: 60)
587 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
588 :java-version: Version of Java to use for the build. (default: openjdk8)
589 :mvn-global-settings: The name of the Maven global settings to use for
590 Maven configuration. (default: global-settings)
591 :mvn-opts: Sets MAVEN_OPTS. (default: '')
592 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
593 :mvn-version: Version of maven to use. (default: mvn35)
594 :stream: Keyword that can be used to represent a release code-name.
595 Often the same as the branch. (default: master)
596 :submodule-recursive: Whether to checkout submodules recursively.
598 :submodule-timeout: Timeout (in minutes) for checkout operation.
600 :submodule-disable: Disable submodule checkout operation.
603 :gerrit_verify_triggers: Override Gerrit Triggers.
604 :gerrit_trigger_file_paths: Override file paths which can be used to
605 filter which file modifications will trigger a build.