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.
145 :gerrit_merge_triggers: Override Gerrit Triggers.
147 Maven JavaDoc Publish
148 ---------------------
150 Produces and publishes javadocs for a Maven project.
152 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
156 - {project-name}-maven-javadoc-publish-{stream}-{java-version}
157 - gerrit-maven-javadoc-publish
158 - github-maven-javadoc-publish
160 :Comment Trigger: remerge
162 :Required parameters:
164 :build-node: The node to run build on.
165 :javadoc-path: The path in Nexus to deploy javadoc to.
166 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
167 be configured in defaults.yaml)
168 :mvn-settings: The name of settings file containing credentials for the project.
169 :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
170 (Note: This setting should be configured in defaults.yaml.)
172 :Optional parameters:
174 :branch: The branch to build against. (default: master)
175 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
176 :build-timeout: Timeout in minutes before aborting build. (default: 60)
177 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
178 :java-version: Version of Java to use for the build. (default: openjdk8)
179 :mvn-global-settings: The name of the Maven global settings to use for
180 Maven configuration. (default: global-settings)
181 :mvn-opts: Sets MAVEN_OPTS. (default: '')
182 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
183 :mvn-version: Version of maven to use. (default: mvn35)
184 :stream: Keyword that can be used to represent a release code-name.
185 Often the same as the branch. (default: master)
186 :submodule-recursive: Whether to checkout submodules recursively.
188 :submodule-timeout: Timeout (in minutes) for checkout operation.
191 :gerrit_merge_triggers: Override Gerrit Triggers.
196 Produces javadocs for a Maven project.
198 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
202 - {project-name}-maven-javadoc-verify-{stream}-{java-version}
203 - gerrit-maven-javadoc-verify
204 - github-maven-javadoc-verify
206 :Comment Trigger: recheck|reverify
208 :Required parameters:
209 :build-node: The node to run build on.
210 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
211 be configured in defaults.yaml)
212 :mvn-settings: The name of settings file containing credentials for the project.
214 :Optional parameters:
216 :branch: The branch to build against. (default: master)
217 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
218 :build-timeout: Timeout in minutes before aborting build. (default: 60)
219 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
220 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
221 :java-version: Version of Java to use for the build. (default: openjdk8)
222 :mvn-global-settings: The name of the Maven global settings to use for
223 Maven configuration. (default: global-settings)
224 :mvn-opts: Sets MAVEN_OPTS. (default: '')
225 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
226 :mvn-version: Version of maven to use. (default: mvn35)
227 :stream: Keyword that can be used to represent a release code-name.
228 Often the same as the branch. (default: master)
229 :submodule-recursive: Whether to checkout submodules recursively.
231 :submodule-timeout: Timeout (in minutes) for checkout operation.
234 :gerrit_verify_triggers: Override Gerrit Triggers.
239 Merge job which runs `mvn clean deploy` to build a project.
241 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
242 goal to push the upload. This is to get around the issue that Maven deploy does
243 not properly support uploading files at the end of the build and instead pushes
244 as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
247 This job uses the following strategy to deploy jobs to Nexus:
249 1. `wget -r` to fetch maven-metadata.xml from Nexus
250 2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
251 3. Removes untouched maven-metadata.xml files before upload
252 4. Use lftools (cURL) upload script to push artifacts to Nexus
256 - {project-name}-maven-merge-{stream}
260 :Comment Trigger: remerge
262 :Required parameters:
264 :build-node: The node to run build on.
265 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
266 be configured in defaults.yaml)
267 :mvn-settings: The name of settings file containing credentials for the project.
268 :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
269 (Note: This setting should be configured in defaults.yaml.)
270 :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
272 :Optional parameters:
274 :branch: Git branch to fetch for the build. (default: master)
275 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
276 :build-timeout: Timeout in minutes before aborting build. (default: 60)
277 :cron: Cron schedule when to trigger the job. This parameter also
278 supports multiline input via YAML pipe | character in cases where
279 one may want to provide more than 1 cron timer. (default: 'H H * * 0'
281 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
282 :java-version: Version of Java to use for the build. (default: openjdk8)
283 :mvn-global-settings: The name of the Maven global settings to use for
284 Maven configuration. (default: global-settings)
285 :mvn-opts: Sets MAVEN_OPTS. (default: '')
286 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
287 :mvn-version: Version of maven to use. (default: mvn35)
288 :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
289 :stream: Keyword that can be used to represent a release code-name.
290 Often the same as the branch. (default: master)
291 :submodule-recursive: Whether to checkout submodules recursively.
293 :submodule-timeout: Timeout (in minutes) for checkout operation.
296 :gerrit_merge_triggers: Override Gerrit Triggers.
297 :gerrit_trigger_file_paths: Override file paths which can be used to
298 filter which file modifications will trigger a build.
303 Produces a release candidate by creating a staging repo in Nexus.
305 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
306 "autorelease-2000", "odlparent-1201", etc...
308 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
309 directory is then used later to deploy to Nexus.
313 - {project-name}-maven-stage-{stream}
317 :Required parameters:
319 :build-node: The node to run build on.
320 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
321 be configured in defaults.yaml)
322 :mvn-settings: The name of settings file containing credentials for the project.
323 :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
324 (Note: This setting should be configured in defaults.yaml.)
325 :staging-profile-id: Profile ID of the project's Nexus staging profile.
327 :Optional parameters:
329 :archive-artifacts: Artifacts to archive to the logs server (default: '').
330 :branch: The branch to build against. (default: master)
331 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
332 :build-timeout: Timeout in minutes before aborting build. (default: 60)
333 :cron: Cron schedule when to trigger the job. This parameter also
334 supports multiline input via YAML pipe | character in cases where
335 one may want to provide more than 1 cron timer. (default: '')
336 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
337 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
338 :java-version: Version of Java to use for the build. (default: openjdk8)
339 :mvn-central: Set to 'true' to also stage to OSSRH. This is for projects
340 that want to release to Maven Central. If set the parameter
341 ``ossrh-profile-id`` also needs to be set. (default: false)
342 :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
343 :mvn-global-settings: The name of the Maven global settings to use for
344 Maven configuration. (default: global-settings)
345 :mvn-opts: Sets MAVEN_OPTS. (default: '')
346 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
347 :mvn-version: Version of maven to use. (default: mvn35)
348 :ossrh-profile-id: Profile ID for project as provided by OSSRH.
350 :sign-artifacts: Sign artifacts with Sigul. (default: false)
351 :stream: Keyword that can be used to represent a release code-name.
352 Often the same as the branch. (default: master)
353 :submodule-recursive: Whether to checkout submodules recursively.
355 :submodule-timeout: Timeout (in minutes) for checkout operation.
358 :gerrit_release_triggers: Override Gerrit Triggers.
365 Sonar job which runs mvn clean install then publishes to Sonar.
367 This job purposely only runs on the master branch as there are Additional
368 configuration needed to support multiple branches and there's not much
369 interest in that kind of support.
373 - {project-name}-sonar
377 :Comment Trigger: run-sonar
379 :Required parameters:
381 :build-node: The node to run build on.
382 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
383 be configured in defaults.yaml)
384 :mvn-settings: The name of settings file containing credentials for the project.
386 :Optional parameters:
388 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
389 :build-timeout: Timeout in minutes before aborting build. (default: 60)
390 :cron: Cron schedule when to trigger the job. This parameter also
391 supports multiline input via YAML pipe | character in cases where
392 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
394 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
395 :java-version: Version of Java to use for the build. (default: openjdk8)
396 :mvn-global-settings: The name of the Maven global settings to use for
397 Maven configuration. (default: global-settings)
398 :mvn-opts: Sets MAVEN_OPTS. (default: '')
399 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
400 :mvn-version: Version of maven to use. (default: mvn35)
401 :sonar-mvn-goals: Maven goals to run for sonar analysis.
402 (default: sonar:sonar)
403 :sonarcloud: Whether or not to use SonarCloud ``true|false``.
405 :sonarcloud-project-key: SonarCloud project key. (default: '')
406 :sonarcloud-project-organization: SonarCloud project organization.
408 :sonarcloud-api-token: SonarCloud API Token. (default: '')
409 :stream: Keyword that can be used to represent a release code-name.
410 Often the same as the branch. (default: master)
411 :submodule-recursive: Whether to checkout submodules recursively.
413 :submodule-timeout: Timeout (in minutes) for checkout operation.
416 :gerrit_sonar_triggers: Override Gerrit Triggers.
421 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
427 Verify job which runs mvn clean install to test a project build..
431 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
432 - gerrit-maven-verify
433 - github-maven-verify
435 :Comment Trigger: recheck|reverify
437 :Required parameters:
439 :build-node: The node to run build on.
440 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
441 be configured in defaults.yaml)
442 :mvn-settings: The name of settings file containing credentials for the project.
444 :Optional parameters:
446 :branch: Git branch to fetch for the build. (default: master)
447 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
448 :build-timeout: Timeout in minutes before aborting build. (default: 60)
449 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
450 :java-version: Version of Java to use for the build. (default: openjdk8)
451 :mvn-global-settings: The name of the Maven global settings to use for
452 Maven configuration. (default: global-settings)
453 :mvn-opts: Sets MAVEN_OPTS. (default: '')
454 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
455 :mvn-version: Version of maven to use. (default: mvn35)
456 :stream: Keyword that can be used to represent a release code-name.
457 Often the same as the branch. (default: master)
458 :submodule-recursive: Whether to checkout submodules recursively.
460 :submodule-timeout: Timeout (in minutes) for checkout operation.
463 :gerrit_verify_triggers: Override Gerrit Triggers.
464 :gerrit_trigger_file_paths: Override file paths which can be used to
465 filter which file modifications will trigger a build.
467 Maven Verify /w Dependencies
468 ----------------------------
470 Verify job which runs mvn clean install to test a project build /w deps
472 This job can be used to verify a patch in conjunction to all of the
473 upstream patches it depends on. The user of this job can provide a list
478 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
479 - gerrit-maven-verify-dependencies
481 :Comment Trigger: recheck: SPACE_SEPERATED_LIST_OF_PATCHES
483 :Required parameters:
485 :build-node: The node to run build on.
486 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
487 be configured in defaults.yaml)
488 :mvn-settings: The name of settings file containing credentials for the project.
490 :Optional parameters:
492 :branch: Git branch to fetch for the build. (default: master)
493 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
494 :build-timeout: Timeout in minutes before aborting build. (default: 60)
495 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
496 :java-version: Version of Java to use for the build. (default: openjdk8)
497 :mvn-global-settings: The name of the Maven global settings to use for
498 Maven configuration. (default: global-settings)
499 :mvn-opts: Sets MAVEN_OPTS. (default: '')
500 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
501 :mvn-version: Version of maven to use. (default: mvn35)
502 :stream: Keyword that can be used to represent a release code-name.
503 Often the same as the branch. (default: master)
504 :submodule-recursive: Whether to checkout submodules recursively.
506 :submodule-timeout: Timeout (in minutes) for checkout operation.
509 :gerrit_verify_triggers: Override Gerrit Triggers.
510 :gerrit_trigger_file_paths: Override file paths which can be used to
511 filter which file modifications will trigger a build.