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 :Required parameters:
356 :build-node: The node to run build on.
357 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
358 be configured in defaults.yaml)
359 :mvn-settings: The name of settings file containing credentials for the project.
360 :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
361 (Note: This setting should be configured in defaults.yaml.)
362 :staging-profile-id: Profile ID of the project's Nexus staging profile.
364 :Optional parameters:
366 :archive-artifacts: Artifacts to archive to the logs server (default: '').
367 :branch: The branch to build against. (default: master)
368 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
369 :build-timeout: Timeout in minutes before aborting build. (default: 60)
370 :cron: Cron schedule when to trigger the job. This parameter also
371 supports multiline input via YAML pipe | character in cases where
372 one may want to provide more than 1 cron timer. (default: '')
373 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
374 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
375 :java-version: Version of Java to use for the build. (default: openjdk8)
376 :mvn-central: Set to 'true' to also stage to OSSRH. This is for projects
377 that want to release to Maven Central. If set the parameter
378 ``ossrh-profile-id`` also needs to be set. (default: false)
379 :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
380 :mvn-global-settings: The name of the Maven global settings to use for
381 Maven configuration. (default: global-settings)
382 :mvn-opts: Sets MAVEN_OPTS. (default: '')
383 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
384 :mvn-version: Version of maven to use. (default: mvn35)
385 :ossrh-profile-id: Profile ID for project as provided by OSSRH.
387 :sign-artifacts: Sign artifacts with Sigul. (default: false)
388 :stream: Keyword that can be used to represent a release code-name.
389 Often the same as the branch. (default: master)
390 :submodule-recursive: Whether to checkout submodules recursively.
392 :submodule-timeout: Timeout (in minutes) for checkout operation.
394 :submodule-disable: Disable submodule checkout operation.
396 :version-properties-file: Name and path of the version properties file.
397 (default: version.properties)
399 :gerrit_release_triggers: Override Gerrit Triggers.
400 :gerrit_trigger_file_paths: Override file paths which can be used to
401 filter which file modifications will trigger a build.
403 Maven Stage for Docker
404 ----------------------
406 Produces a release candidate docker image in a Nexus registry.
407 Appropriate for Java projects that do not need to deploy any POM or
410 Similar to Maven Stage as described above but logs in to Docker
411 registries first and skips the lf-maven-deploy builder. The project
412 POM file should invoke a plugin to build and push a Docker image. The
413 base image should be pulled from the registry in the environment
414 variable CONTAINER_PULL_REGISTRY. The new image should be pushed to the
415 registry in the environment variable CONTAINER_PUSH_REGISTRY.
419 - {project-name}-maven-docker-stage-{stream}
420 - gerrit-maven-docker-stage
421 - github-maven-docker-stage
423 :Required parameters:
425 :container-public-registry: Docker registry source with base images.
426 :container-staging-registry: Docker registry target for the deploy action.
428 All other required and optional parameters are identical to the Maven Stage job
436 Sonar job which runs mvn clean install then publishes to Sonar.
438 This job purposely only runs on the master branch as there are Additional
439 configuration needed to support multiple branches and there's not much
440 interest in that kind of support.
444 - {project-name}-sonar
448 :Comment Trigger: run-sonar
450 :Required parameters:
452 :build-node: The node to run build on.
453 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
454 be configured in defaults.yaml)
455 :mvn-settings: The name of settings file containing credentials for the project.
457 :Optional parameters:
459 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
460 :build-timeout: Timeout in minutes before aborting build. (default: 60)
461 :cron: Cron schedule when to trigger the job. This parameter also
462 supports multiline input via YAML pipe | character in cases where
463 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
465 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
466 :java-version: Version of Java to use for the build. (default: openjdk8)
467 :mvn-global-settings: The name of the Maven global settings to use for
468 Maven configuration. (default: global-settings)
469 :mvn-opts: Sets MAVEN_OPTS. (default: '')
470 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
471 :mvn-version: Version of maven to use. (default: mvn35)
472 :sonar-mvn-goals: Maven goals to run for sonar analysis.
473 (default: sonar:sonar)
474 :sonarcloud: Whether or not to use SonarCloud ``true|false``.
476 :sonarcloud-project-key: SonarCloud project key. (default: '')
477 :sonarcloud-project-organization: SonarCloud project organization.
479 :sonarcloud-api-token: SonarCloud API Token. (default: '')
480 :stream: Keyword that can be used to represent a release code-name.
481 Often the same as the branch. (default: master)
482 :submodule-recursive: Whether to checkout submodules recursively.
484 :submodule-timeout: Timeout (in minutes) for checkout operation.
486 :submodule-disable: Disable submodule checkout operation.
489 :gerrit_sonar_triggers: Override Gerrit Triggers.
494 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
500 Verify job which runs mvn clean install to test a project build..
504 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
505 - gerrit-maven-verify
506 - github-maven-verify
508 :Comment Trigger: recheck|reverify
510 :Required parameters:
512 :build-node: The node to run build on.
513 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
514 be configured in defaults.yaml)
515 :mvn-settings: The name of settings file containing credentials for the project.
517 :Optional parameters:
519 :branch: Git branch to fetch for the build. (default: master)
520 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
521 :build-timeout: Timeout in minutes before aborting build. (default: 60)
522 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
523 :java-version: Version of Java to use for the build. (default: openjdk8)
524 :mvn-global-settings: The name of the Maven global settings to use for
525 Maven configuration. (default: global-settings)
526 :mvn-opts: Sets MAVEN_OPTS. (default: '')
527 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
528 :mvn-version: Version of maven to use. (default: mvn35)
529 :stream: Keyword that can be used to represent a release code-name.
530 Often the same as the branch. (default: master)
531 :submodule-recursive: Whether to checkout submodules recursively.
533 :submodule-timeout: Timeout (in minutes) for checkout operation.
535 :submodule-disable: Disable submodule checkout operation.
538 :gerrit_verify_triggers: Override Gerrit Triggers.
539 :gerrit_trigger_file_paths: Override file paths which can be used to
540 filter which file modifications will trigger a build.
542 Maven Verify for Docker
543 -----------------------
545 Similar to Maven Verify as described above but logs in to Docker
546 registries first. The project POM file should invoke a plugin to build
547 a Docker image. The base image should be pulled from the registry in
548 the environment variable CONTAINER_PULL_REGISTRY.
552 - {project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}
553 - gerrit-maven-docker-verify
554 - github-maven-docker-verify
556 :Required parameters:
558 :container-public-registry: Docker registry source with base images.
560 All other required and optional parameters are identical to the Maven Verify job
563 Maven Verify w/ Dependencies
564 ----------------------------
566 Verify job which runs mvn clean install to test a project build /w deps
568 This job can be used to verify a patch in conjunction to all of the
569 upstream patches it depends on. The user of this job can provide a list
574 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
575 - gerrit-maven-verify-dependencies
577 :Comment Trigger: recheck: SPACE_SEPARATED_LIST_OF_PATCHES
579 :Required parameters:
581 :build-node: The node to run build on.
582 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
583 be configured in defaults.yaml)
584 :mvn-settings: The name of settings file containing credentials for the project.
586 :Optional parameters:
588 :branch: Git branch to fetch for the build. (default: master)
589 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
590 :build-timeout: Timeout in minutes before aborting build. (default: 60)
591 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
592 :java-version: Version of Java to use for the build. (default: openjdk8)
593 :mvn-global-settings: The name of the Maven global settings to use for
594 Maven configuration. (default: global-settings)
595 :mvn-opts: Sets MAVEN_OPTS. (default: '')
596 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
597 :mvn-version: Version of maven to use. (default: mvn35)
598 :stream: Keyword that can be used to represent a release code-name.
599 Often the same as the branch. (default: master)
600 :submodule-recursive: Whether to checkout submodules recursively.
602 :submodule-timeout: Timeout (in minutes) for checkout operation.
604 :submodule-disable: Disable submodule checkout operation.
607 :gerrit_verify_triggers: Override Gerrit Triggers.
608 :gerrit_trigger_file_paths: Override file paths which can be used to
609 filter which file modifications will trigger a build.