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.
397 Maven Stage for Docker
398 ----------------------
400 Produces a release candidate docker image in a Nexus registry.
401 Appropriate for Java projects that do not need to deploy any POM or
404 Similar to Maven Stage as described above but logs in to Docker
405 registries first and skips the lf-maven-deploy builder. The project
406 POM file should invoke a plugin to build and push a Docker image. The
407 base image should be pulled from the registry in the environment
408 variable CONTAINER_PULL_REGISTRY. The new image should be pushed to the
409 registry in the environment variable CONTAINER_PUSH_REGISTRY.
413 - {project-name}-maven-docker-stage-{stream}
414 - gerrit-maven-docker-stage
415 - github-maven-docker-stage
417 :Required parameters:
419 :container-public-registry: Docker registry source with base images.
420 :container-staging-registry: Docker registry target for the deploy action.
422 All other required and optional parameters are identical to the Maven Stage job
430 Sonar job which runs mvn clean install then publishes to Sonar.
432 This job purposely only runs on the master branch as there are Additional
433 configuration needed to support multiple branches and there's not much
434 interest in that kind of support.
438 - {project-name}-sonar
442 :Comment Trigger: run-sonar
444 :Required parameters:
446 :build-node: The node to run build on.
447 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
448 be configured in defaults.yaml)
449 :mvn-settings: The name of settings file containing credentials for the project.
451 :Optional parameters:
453 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
454 :build-timeout: Timeout in minutes before aborting build. (default: 60)
455 :cron: Cron schedule when to trigger the job. This parameter also
456 supports multiline input via YAML pipe | character in cases where
457 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
459 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
460 :java-version: Version of Java to use for the build. (default: openjdk8)
461 :mvn-global-settings: The name of the Maven global settings to use for
462 Maven configuration. (default: global-settings)
463 :mvn-opts: Sets MAVEN_OPTS. (default: '')
464 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
465 :mvn-version: Version of maven to use. (default: mvn35)
466 :sonar-mvn-goals: Maven goals to run for sonar analysis.
467 (default: sonar:sonar)
468 :sonarcloud: Whether or not to use SonarCloud ``true|false``.
470 :sonarcloud-project-key: SonarCloud project key. (default: '')
471 :sonarcloud-project-organization: SonarCloud project organization.
473 :sonarcloud-api-token: SonarCloud API Token. (default: '')
474 :stream: Keyword that can be used to represent a release code-name.
475 Often the same as the branch. (default: master)
476 :submodule-recursive: Whether to checkout submodules recursively.
478 :submodule-timeout: Timeout (in minutes) for checkout operation.
480 :submodule-disable: Disable submodule checkout operation.
483 :gerrit_sonar_triggers: Override Gerrit Triggers.
488 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
494 Verify job which runs mvn clean install to test a project build..
498 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
499 - gerrit-maven-verify
500 - github-maven-verify
502 :Comment Trigger: recheck|reverify
504 :Required parameters:
506 :build-node: The node to run build on.
507 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
508 be configured in defaults.yaml)
509 :mvn-settings: The name of settings file containing credentials for the project.
511 :Optional parameters:
513 :branch: Git branch to fetch for the build. (default: master)
514 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
515 :build-timeout: Timeout in minutes before aborting build. (default: 60)
516 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
517 :java-version: Version of Java to use for the build. (default: openjdk8)
518 :mvn-global-settings: The name of the Maven global settings to use for
519 Maven configuration. (default: global-settings)
520 :mvn-opts: Sets MAVEN_OPTS. (default: '')
521 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
522 :mvn-version: Version of maven to use. (default: mvn35)
523 :stream: Keyword that can be used to represent a release code-name.
524 Often the same as the branch. (default: master)
525 :submodule-recursive: Whether to checkout submodules recursively.
527 :submodule-timeout: Timeout (in minutes) for checkout operation.
529 :submodule-disable: Disable submodule checkout operation.
532 :gerrit_verify_triggers: Override Gerrit Triggers.
533 :gerrit_trigger_file_paths: Override file paths which can be used to
534 filter which file modifications will trigger a build.
536 Maven Verify for Docker
537 -----------------------
539 Similar to Maven Verify as described above but logs in to Docker
540 registries first. The project POM file should invoke a plugin to build
541 a Docker image. The base image should be pulled from the registry in
542 the environment variable CONTAINER_PULL_REGISTRY.
546 - {project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}
547 - gerrit-maven-docker-verify
548 - github-maven-docker-verify
550 :Required parameters:
552 :container-public-registry: Docker registry source with base images.
554 All other required and optional parameters are identical to the Maven Verify job
557 Maven Verify w/ Dependencies
558 ----------------------------
560 Verify job which runs mvn clean install to test a project build /w deps
562 This job can be used to verify a patch in conjunction to all of the
563 upstream patches it depends on. The user of this job can provide a list
568 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
569 - gerrit-maven-verify-dependencies
571 :Comment Trigger: recheck: SPACE_SEPARATED_LIST_OF_PATCHES
573 :Required parameters:
575 :build-node: The node to run build on.
576 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
577 be configured in defaults.yaml)
578 :mvn-settings: The name of settings file containing credentials for the project.
580 :Optional parameters:
582 :branch: Git branch to fetch for the build. (default: master)
583 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
584 :build-timeout: Timeout in minutes before aborting build. (default: 60)
585 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
586 :java-version: Version of Java to use for the build. (default: openjdk8)
587 :mvn-global-settings: The name of the Maven global settings to use for
588 Maven configuration. (default: global-settings)
589 :mvn-opts: Sets MAVEN_OPTS. (default: '')
590 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
591 :mvn-version: Version of maven to use. (default: mvn35)
592 :stream: Keyword that can be used to represent a release code-name.
593 Often the same as the branch. (default: master)
594 :submodule-recursive: Whether to checkout submodules recursively.
596 :submodule-timeout: Timeout (in minutes) for checkout operation.
598 :submodule-disable: Disable submodule checkout operation.
601 :gerrit_verify_triggers: Override Gerrit Triggers.
602 :gerrit_trigger_file_paths: Override file paths which can be used to
603 filter which file modifications will trigger a build.