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 :version-properties-file: Name and path of the version properties file.
73 (default: version.properties)
74 :mvn-version: Version of Maven to execute Sonar with.
75 :mvn-pom: Location of pom.xml.
76 :mvn-settings: Maven settings.xml file containing credentials to use.
81 Calls the maven stage script to push artifacts to a Nexus staging repository.
85 :mvn-global-settings: The name of the Maven global settings to use for
87 :mvn-settings: The name of settings file containing credentials for the project.
89 lf-update-java-alternatives
90 ---------------------------
92 Setup Java alternatives for the Distro.
96 :java-version: Version of Java to set as the default Java.
105 Produces a CLM scan of the code into Nexus IQ Server.
109 - {project-name}-maven-clm-{stream}
113 :Comment Trigger: run-clm
115 :Required parameters:
117 :build-node: The node to run build on.
118 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
119 be configured in defaults.yaml)
120 :mvn-settings: The name of settings file containing credentials for the project.
122 :Optional parameters:
124 :branch: The branch to build against. (default: master)
125 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
126 :build-timeout: Timeout in minutes before aborting build. (default: 60)
127 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
128 :java-version: Version of Java to use for the build. (default: openjdk8)
129 :mvn-global-settings: The name of the Maven global settings to use for
130 Maven configuration. (default: global-settings)
131 :mvn-opts: Sets MAVEN_OPTS. (default: '')
132 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
133 :mvn-version: Version of maven to use. (default: mvn35)
134 :nexus-iq-namespace: Insert a namespace to project AppID for projects that
135 share a Nexus IQ system to avoid project name collision. We recommend
136 inserting a trailing - dash if using this parameter.
137 For example 'odl-'. (default: '')
138 :nexus-iq-stage: Stage the policy evaluation will be run against on
139 the Nexus IQ Server. (default: 'build')
140 :stream: Keyword that can be used to represent a release code-name.
141 Often the same as the branch. (default: master)
142 :submodule-recursive: Whether to checkout submodules recursively.
144 :submodule-timeout: Timeout (in minutes) for checkout operation.
146 :submodule-disable: Disable submodule checkout operation.
149 :gerrit_merge_triggers: Override Gerrit Triggers.
151 Maven JavaDoc Publish
152 ---------------------
154 Produces and publishes javadocs for a Maven project.
156 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
160 - {project-name}-maven-javadoc-publish-{stream}-{java-version}
161 - gerrit-maven-javadoc-publish
162 - github-maven-javadoc-publish
164 :Comment Trigger: remerge
166 :Required parameters:
168 :build-node: The node to run build on.
169 :javadoc-path: The path in Nexus to deploy javadoc to.
170 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
171 be configured in defaults.yaml)
172 :mvn-settings: The name of settings file containing credentials for the project.
173 :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
174 (Note: This setting should be configured in defaults.yaml.)
176 :Optional parameters:
178 :branch: The branch to build against. (default: master)
179 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
180 :build-timeout: Timeout in minutes before aborting build. (default: 60)
181 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
182 :java-version: Version of Java to use for the build. (default: openjdk8)
183 :mvn-global-settings: The name of the Maven global settings to use for
184 Maven configuration. (default: global-settings)
185 :mvn-opts: Sets MAVEN_OPTS. (default: '')
186 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
187 :mvn-version: Version of maven to use. (default: mvn35)
188 :stream: Keyword that can be used to represent a release code-name.
189 Often the same as the branch. (default: master)
190 :submodule-recursive: Whether to checkout submodules recursively.
192 :submodule-timeout: Timeout (in minutes) for checkout operation.
194 :submodule-disable: Disable submodule checkout operation.
197 :gerrit_merge_triggers: Override Gerrit Triggers.
202 Produces javadocs for a Maven project.
204 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
208 - {project-name}-maven-javadoc-verify-{stream}-{java-version}
209 - gerrit-maven-javadoc-verify
210 - github-maven-javadoc-verify
212 :Comment Trigger: recheck|reverify
214 :Required parameters:
215 :build-node: The node to run build on.
216 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
217 be configured in defaults.yaml)
218 :mvn-settings: The name of settings file containing credentials for the project.
220 :Optional parameters:
222 :branch: The branch to build against. (default: master)
223 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
224 :build-timeout: Timeout in minutes before aborting build. (default: 60)
225 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
226 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
227 :java-version: Version of Java to use for the build. (default: openjdk8)
228 :mvn-global-settings: The name of the Maven global settings to use for
229 Maven configuration. (default: global-settings)
230 :mvn-opts: Sets MAVEN_OPTS. (default: '')
231 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
232 :mvn-version: Version of maven to use. (default: mvn35)
233 :stream: Keyword that can be used to represent a release code-name.
234 Often the same as the branch. (default: master)
235 :submodule-recursive: Whether to checkout submodules recursively.
237 :submodule-timeout: Timeout (in minutes) for checkout operation.
239 :submodule-disable: Disable submodule checkout operation.
242 :gerrit_verify_triggers: Override Gerrit Triggers.
247 Merge job which runs `mvn clean deploy` to build a project.
249 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
250 goal to push the upload. This is to get around the issue that Maven deploy does
251 not properly support uploading files at the end of the build and instead pushes
252 as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
255 This job uses the following strategy to deploy jobs to Nexus:
257 1. `wget -r` to fetch maven-metadata.xml from Nexus
258 2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
259 3. Removes untouched maven-metadata.xml files before upload
260 4. Use lftools (cURL) upload script to push artifacts to Nexus
264 - {project-name}-maven-merge-{stream}
268 :Comment Trigger: remerge
270 :Required parameters:
272 :build-node: The node to run build on.
273 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
274 be configured in defaults.yaml)
275 :mvn-settings: The name of settings file containing credentials for the project.
276 :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
277 (Note: This setting should be configured in defaults.yaml.)
278 :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
280 :Optional parameters:
282 :branch: Git branch to fetch for the build. (default: master)
283 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
284 :build-timeout: Timeout in minutes before aborting build. (default: 60)
285 :cron: Cron schedule when to trigger the job. This parameter also
286 supports multiline input via YAML pipe | character in cases where
287 one may want to provide more than 1 cron timer. (default: 'H H * * 0'
289 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
290 :java-version: Version of Java to use for the build. (default: openjdk8)
291 :mvn-global-settings: The name of the Maven global settings to use for
292 Maven configuration. (default: global-settings)
293 :mvn-opts: Sets MAVEN_OPTS. (default: '')
294 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
295 :mvn-version: Version of maven to use. (default: mvn35)
296 :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
297 :stream: Keyword that can be used to represent a release code-name.
298 Often the same as the branch. (default: master)
299 :submodule-recursive: Whether to checkout submodules recursively.
301 :submodule-timeout: Timeout (in minutes) for checkout operation.
303 :submodule-disable: Disable submodule checkout operation.
306 :gerrit_merge_triggers: Override Gerrit Triggers.
307 :gerrit_trigger_file_paths: Override file paths which can be used to
308 filter which file modifications will trigger a build.
310 Maven Merge for Docker
311 ----------------------
313 Produces a snapshot docker image in a Nexus registry. Appropriate for
314 Java projects that do not need to deploy any POM or JAR files.
316 Similar to Maven Merge as described above but logs in to Docker
317 registries first and skips the lf-maven-deploy builder. The project
318 POM file should invoke a plugin to build and push a Docker image. The
319 base image should be pulled from the registry in the environment
320 variable CONTAINER_PULL_REGISTRY. The new image should be pushed to the
321 registry in the environment variable CONTAINER_PUSH_REGISTRY.
325 - {project-name}-maven-docker-merge-{stream}
326 - gerrit-maven-docker-merge
327 - github-maven-docker-merge
329 :Required parameters:
331 :container-public-registry: Docker registry source with base images.
332 :container-snapshot-registry: Docker registry target for the deploy action.
334 All other required and optional parameters are identical to the Maven Merge job
340 Produces a release candidate by creating a staging repo in Nexus.
342 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
343 "autorelease-2000", "odlparent-1201", etc...
345 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
346 directory is then used later to deploy to Nexus.
350 - {project-name}-maven-stage-{stream}
354 :Comment Trigger: "stage-release" or "stage-maven-release"
356 :Required parameters:
358 :build-node: The node to run build on.
359 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
360 be configured in defaults.yaml)
361 :mvn-settings: The name of settings file containing credentials for the project.
362 :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
363 (Note: This setting should be configured in defaults.yaml.)
364 :staging-profile-id: Profile ID of the project's Nexus staging profile.
366 :Optional parameters:
368 :archive-artifacts: Artifacts to archive to the logs server (default: '').
369 :branch: The branch to build against. (default: master)
370 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
371 :build-timeout: Timeout in minutes before aborting build. (default: 60)
372 :cron: Cron schedule when to trigger the job. This parameter also
373 supports multiline input via YAML pipe | character in cases where
374 one may want to provide more than 1 cron timer. (default: '')
375 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
376 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
377 :java-version: Version of Java to use for the build. (default: openjdk8)
378 :mvn-central: Set to 'true' to also stage to OSSRH. This is for projects
379 that want to release to Maven Central. If set the parameter
380 ``ossrh-profile-id`` also needs to be set. (default: false)
381 :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
382 :mvn-global-settings: The name of the Maven global settings to use for
383 Maven configuration. (default: global-settings)
384 :mvn-opts: Sets MAVEN_OPTS. (default: '')
385 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
386 :mvn-version: Version of maven to use. (default: mvn35)
387 :ossrh-profile-id: Profile ID for project as provided by OSSRH.
389 :sign-artifacts: Sign artifacts with Sigul. (default: false)
390 :stream: Keyword that can be used to represent a release code-name.
391 Often the same as the branch. (default: master)
392 :submodule-recursive: Whether to checkout submodules recursively.
394 :submodule-timeout: Timeout (in minutes) for checkout operation.
396 :submodule-disable: Disable submodule checkout operation.
398 :version-properties-file: Name and path of the version properties file.
399 (default: version.properties)
401 :gerrit_release_triggers: Override Gerrit Triggers.
402 :gerrit_trigger_file_paths: Override file paths which can be used to
403 filter which file modifications will trigger a build.
405 Maven Stage for Docker
406 ----------------------
408 Produces a release candidate docker image in a Nexus registry.
409 Appropriate for Java projects that do not need to deploy any POM or
412 Similar to Maven Stage as described above but logs in to Docker
413 registries first and skips the lf-maven-deploy builder. The project
414 POM file should invoke a plugin to build and push a Docker image. The
415 base image should be pulled from the registry in the environment
416 variable CONTAINER_PULL_REGISTRY. The new image should be pushed to the
417 registry in the environment variable CONTAINER_PUSH_REGISTRY.
421 - {project-name}-maven-docker-stage-{stream}
422 - gerrit-maven-docker-stage
423 - github-maven-docker-stage
425 :Comment Trigger: "stage-release" or "stage-docker-release"
427 :Required parameters:
429 :container-public-registry: Docker registry source with base images.
430 :container-staging-registry: Docker registry target for the deploy action.
432 :Optional parameters:
434 :gerrit_release_docker_triggers: Override Gerrit Triggers.
436 All other required and optional parameters are identical to the Maven Stage job
444 Sonar job which runs mvn clean install then publishes to Sonar.
446 This job purposely only runs on the master branch as there are Additional
447 configuration needed to support multiple branches and there's not much
448 interest in that kind of support.
452 - {project-name}-sonar
456 :Comment Trigger: run-sonar
458 :Required parameters:
460 :build-node: The node to run build on.
461 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
462 be configured in defaults.yaml)
463 :mvn-settings: The name of settings file containing credentials for the project.
465 :Optional parameters:
467 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
468 :build-timeout: Timeout in minutes before aborting build. (default: 60)
469 :cron: Cron schedule when to trigger the job. This parameter also
470 supports multiline input via YAML pipe | character in cases where
471 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
473 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
474 :java-version: Version of Java to use for the build. (default: openjdk8)
475 :mvn-global-settings: The name of the Maven global settings to use for
476 Maven configuration. (default: global-settings)
477 :mvn-goals: The maven goals to perform for the build.
478 (default: clean install)
479 :mvn-opts: Sets MAVEN_OPTS. (default: '')
480 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
481 :mvn-version: Version of maven to use. (default: mvn35)
482 :sonar-mvn-goals: Maven goals to run for sonar analysis.
483 (default: sonar:sonar)
484 :sonarcloud: Whether or not to use SonarCloud ``true|false``.
486 :sonarcloud-project-key: SonarCloud project key. (default: '')
487 :sonarcloud-project-organization: SonarCloud project organization.
489 :sonarcloud-api-token: SonarCloud API Token. (default: '')
490 :stream: Keyword that can be used to represent a release code-name.
491 Often the same as the branch. (default: master)
492 :submodule-recursive: Whether to checkout submodules recursively.
494 :submodule-timeout: Timeout (in minutes) for checkout operation.
496 :submodule-disable: Disable submodule checkout operation.
499 :gerrit_sonar_triggers: Override Gerrit Triggers.
504 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
510 Verify job which runs mvn clean install to test a project build..
514 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
515 - gerrit-maven-verify
516 - github-maven-verify
518 :Comment Trigger: recheck|reverify
520 :Required parameters:
522 :build-node: The node to run build on.
523 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
524 be configured in defaults.yaml)
525 :mvn-settings: The name of settings file containing credentials for the project.
527 :Optional parameters:
529 :branch: Git branch to fetch for the build. (default: master)
530 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
531 :build-timeout: Timeout in minutes before aborting build. (default: 60)
532 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
533 :java-version: Version of Java to use for the build. (default: openjdk8)
534 :mvn-global-settings: The name of the Maven global settings to use for
535 Maven configuration. (default: global-settings)
536 :mvn-opts: Sets MAVEN_OPTS. (default: '')
537 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
538 :mvn-version: Version of maven to use. (default: mvn35)
539 :stream: Keyword that can be used to represent a release code-name.
540 Often the same as the branch. (default: master)
541 :submodule-recursive: Whether to checkout submodules recursively.
543 :submodule-timeout: Timeout (in minutes) for checkout operation.
545 :submodule-disable: Disable submodule checkout operation.
548 :gerrit_verify_triggers: Override Gerrit Triggers.
549 :gerrit_trigger_file_paths: Override file paths which can be used to
550 filter which file modifications will trigger a build.
552 Maven Verify for Docker
553 -----------------------
555 Similar to Maven Verify as described above but logs in to Docker
556 registries first. The project POM file should invoke a plugin to build
557 a Docker image. The base image should be pulled from the registry in
558 the environment variable CONTAINER_PULL_REGISTRY.
562 - {project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}
563 - gerrit-maven-docker-verify
564 - github-maven-docker-verify
566 :Required parameters:
568 :container-public-registry: Docker registry source with base images.
570 All other required and optional parameters are identical to the Maven Verify job
573 Maven Verify w/ Dependencies
574 ----------------------------
576 Verify job which runs mvn clean install to test a project build /w deps
578 This job can be used to verify a patch in conjunction to all of the
579 upstream patches it depends on. The user of this job can provide a list
584 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
585 - gerrit-maven-verify-dependencies
587 :Comment Trigger: recheck: SPACE_SEPARATED_LIST_OF_PATCHES
589 :Required parameters:
591 :build-node: The node to run build on.
592 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
593 be configured in defaults.yaml)
594 :mvn-settings: The name of settings file containing credentials for the project.
596 :Optional parameters:
598 :branch: Git branch to fetch for the build. (default: master)
599 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
600 :build-timeout: Timeout in minutes before aborting build. (default: 60)
601 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
602 :java-version: Version of Java to use for the build. (default: openjdk8)
603 :mvn-global-settings: The name of the Maven global settings to use for
604 Maven configuration. (default: global-settings)
605 :mvn-opts: Sets MAVEN_OPTS. (default: '')
606 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
607 :mvn-version: Version of maven to use. (default: mvn35)
608 :stream: Keyword that can be used to represent a release code-name.
609 Often the same as the branch. (default: master)
610 :submodule-recursive: Whether to checkout submodules recursively.
612 :submodule-timeout: Timeout (in minutes) for checkout operation.
614 :submodule-disable: Disable submodule checkout operation.
617 :gerrit_verify_triggers: Override Gerrit Triggers.
618 :gerrit_trigger_file_paths: Override file paths which can be used to
619 filter which file modifications will trigger a build.