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 :maven-versions-plugin-set-version: Version number to upgrade to.
75 :mvn-settings: Maven settings.xml file containing credentials to use.
80 Calls the maven stage script to push artifacts to a Nexus staging repository.
84 :mvn-global-settings: The name of the Maven global settings to use for
86 :mvn-settings: The name of settings file containing credentials for the project.
88 lf-update-java-alternatives
89 ---------------------------
91 Setup Java alternatives for the Distro.
95 :java-version: Version of Java to set as the default Java.
104 Produces a CLM scan of the code into Nexus IQ Server.
108 - {project-name}-maven-clm-{stream}
112 :Comment Trigger: run-clm
114 :Required parameters:
116 :build-node: The node to run build on.
117 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
118 be configured in defaults.yaml)
119 :mvn-settings: The name of settings file containing credentials for the project.
121 :Optional parameters:
123 :branch: The branch to build against. (default: master)
124 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
125 :build-timeout: Timeout in minutes before aborting build. (default: 60)
126 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
127 :java-version: Version of Java to use for the build. (default: openjdk8)
128 :mvn-global-settings: The name of the Maven global settings to use for
129 Maven configuration. (default: global-settings)
130 :mvn-opts: Sets MAVEN_OPTS. (default: '')
131 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
132 :mvn-version: Version of maven to use. (default: mvn35)
133 :nexus-iq-namespace: Insert a namespace to project AppID for projects that
134 share a Nexus IQ system to avoid project name collision. We recommend
135 inserting a trailing - dash if using this parameter.
136 For example 'odl-'. (default: '')
137 :nexus-iq-stage: Stage the policy evaluation will be run against on
138 the Nexus IQ Server. (default: 'build')
139 :stream: Keyword that can be used to represent a release code-name.
140 Often the same as the branch. (default: master)
141 :submodule-recursive: Whether to checkout submodules recursively.
143 :submodule-timeout: Timeout (in minutes) for checkout operation.
146 :gerrit_merge_triggers: Override Gerrit Triggers.
148 Maven JavaDoc Publish
149 ---------------------
151 Produces and publishes javadocs for a Maven project.
153 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
157 - {project-name}-maven-javadoc-publish-{stream}-{java-version}
158 - gerrit-maven-javadoc-publish
159 - github-maven-javadoc-publish
161 :Comment Trigger: remerge
163 :Required parameters:
165 :build-node: The node to run build on.
166 :javadoc-path: The path in Nexus to deploy javadoc to.
167 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
168 be configured in defaults.yaml)
169 :mvn-settings: The name of settings file containing credentials for the project.
170 :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
171 (Note: This setting should be configured in defaults.yaml.)
173 :Optional parameters:
175 :branch: The branch to build against. (default: master)
176 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
177 :build-timeout: Timeout in minutes before aborting build. (default: 60)
178 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
179 :java-version: Version of Java to use for the build. (default: openjdk8)
180 :mvn-global-settings: The name of the Maven global settings to use for
181 Maven configuration. (default: global-settings)
182 :mvn-opts: Sets MAVEN_OPTS. (default: '')
183 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
184 :mvn-version: Version of maven to use. (default: mvn35)
185 :stream: Keyword that can be used to represent a release code-name.
186 Often the same as the branch. (default: master)
187 :submodule-recursive: Whether to checkout submodules recursively.
189 :submodule-timeout: Timeout (in minutes) for checkout operation.
192 :gerrit_merge_triggers: Override Gerrit Triggers.
197 Produces javadocs for a Maven project.
199 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
203 - {project-name}-maven-javadoc-verify-{stream}-{java-version}
204 - gerrit-maven-javadoc-verify
205 - github-maven-javadoc-verify
207 :Comment Trigger: recheck|reverify
209 :Required parameters:
210 :build-node: The node to run build on.
211 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
212 be configured in defaults.yaml)
213 :mvn-settings: The name of settings file containing credentials for the project.
215 :Optional parameters:
217 :branch: The branch to build against. (default: master)
218 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
219 :build-timeout: Timeout in minutes before aborting build. (default: 60)
220 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
221 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
222 :java-version: Version of Java to use for the build. (default: openjdk8)
223 :mvn-global-settings: The name of the Maven global settings to use for
224 Maven configuration. (default: global-settings)
225 :mvn-opts: Sets MAVEN_OPTS. (default: '')
226 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
227 :mvn-version: Version of maven to use. (default: mvn35)
228 :stream: Keyword that can be used to represent a release code-name.
229 Often the same as the branch. (default: master)
230 :submodule-recursive: Whether to checkout submodules recursively.
232 :submodule-timeout: Timeout (in minutes) for checkout operation.
235 :gerrit_verify_triggers: Override Gerrit Triggers.
240 Merge job which runs `mvn clean deploy` to build a project.
242 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
243 goal to push the upload. This is to get around the issue that Maven deploy does
244 not properly support uploading files at the end of the build and instead pushes
245 as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
248 This job uses the following strategy to deploy jobs to Nexus:
250 1. `wget -r` to fetch maven-metadata.xml from Nexus
251 2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
252 3. Removes untouched maven-metadata.xml files before upload
253 4. Use lftools (cURL) upload script to push artifacts to Nexus
257 - {project-name}-maven-merge-{stream}
261 :Comment Trigger: remerge
263 :Required parameters:
265 :build-node: The node to run build on.
266 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
267 be configured in defaults.yaml)
268 :mvn-settings: The name of settings file containing credentials for the project.
269 :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
270 (Note: This setting should be configured in defaults.yaml.)
271 :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
273 :Optional parameters:
275 :branch: Git branch to fetch for the build. (default: master)
276 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
277 :build-timeout: Timeout in minutes before aborting build. (default: 60)
278 :cron: Cron schedule when to trigger the job. This parameter also
279 supports multiline input via YAML pipe | character in cases where
280 one may want to provide more than 1 cron timer. (default: 'H H * * 0'
282 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
283 :java-version: Version of Java to use for the build. (default: openjdk8)
284 :mvn-global-settings: The name of the Maven global settings to use for
285 Maven configuration. (default: global-settings)
286 :mvn-opts: Sets MAVEN_OPTS. (default: '')
287 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
288 :mvn-version: Version of maven to use. (default: mvn35)
289 :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
290 :stream: Keyword that can be used to represent a release code-name.
291 Often the same as the branch. (default: master)
292 :submodule-recursive: Whether to checkout submodules recursively.
294 :submodule-timeout: Timeout (in minutes) for checkout operation.
297 :gerrit_merge_triggers: Override Gerrit Triggers.
298 :gerrit_trigger_file_paths: Override file paths which can be used to
299 filter which file modifications will trigger a build.
304 Produces a release candidate by creating a staging repo in Nexus.
306 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
307 "autorelease-2000", "odlparent-1201", etc...
309 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
310 directory is then used later to deploy to Nexus.
314 - {project-name}-maven-stage-{stream}
318 :Required parameters:
320 :build-node: The node to run build on.
321 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
322 be configured in defaults.yaml)
323 :mvn-settings: The name of settings file containing credentials for the project.
324 :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
325 (Note: This setting should be configured in defaults.yaml.)
326 :staging-profile-id: Profile ID of the project's Nexus staging profile.
328 :Optional parameters:
330 :archive-artifacts: Artifacts to archive to the logs server (default: '').
331 :branch: The branch to build against. (default: master)
332 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
333 :build-timeout: Timeout in minutes before aborting build. (default: 60)
334 :cron: Cron schedule when to trigger the job. This parameter also
335 supports multiline input via YAML pipe | character in cases where
336 one may want to provide more than 1 cron timer. (default: '')
337 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
338 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
339 :java-version: Version of Java to use for the build. (default: openjdk8)
340 :mvn-central: Set to 'true' to also stage to OSSRH. This is for projects
341 that want to release to Maven Central. If set the parameter
342 ``ossrh-profile-id`` also needs to be set. (default: false)
343 :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
344 :mvn-global-settings: The name of the Maven global settings to use for
345 Maven configuration. (default: global-settings)
346 :mvn-opts: Sets MAVEN_OPTS. (default: '')
347 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
348 :mvn-version: Version of maven to use. (default: mvn35)
349 :maven-versions-plugin-set-version: New version to use in Maven versions plugin. (default: '')
350 :ossrh-profile-id: Profile ID for project as provided by OSSRH.
352 :sign-artifacts: Sign artifacts with Sigul. (default: false)
353 :stream: Keyword that can be used to represent a release code-name.
354 Often the same as the branch. (default: master)
355 :submodule-recursive: Whether to checkout submodules recursively.
357 :submodule-timeout: Timeout (in minutes) for checkout operation.
360 :gerrit_release_triggers: Override Gerrit Triggers.
367 Sonar job which runs mvn clean install then publishes to Sonar.
369 This job purposely only runs on the master branch as there are Additional
370 configuration needed to support multiple branches and there's not much
371 interest in that kind of support.
375 - {project-name}-sonar
379 :Comment Trigger: run-sonar
381 :Required parameters:
383 :build-node: The node to run build on.
384 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
385 be configured in defaults.yaml)
386 :mvn-settings: The name of settings file containing credentials for the project.
388 :Optional parameters:
390 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
391 :build-timeout: Timeout in minutes before aborting build. (default: 60)
392 :cron: Cron schedule when to trigger the job. This parameter also
393 supports multiline input via YAML pipe | character in cases where
394 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
396 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
397 :java-version: Version of Java to use for the build. (default: openjdk8)
398 :mvn-global-settings: The name of the Maven global settings to use for
399 Maven configuration. (default: global-settings)
400 :mvn-opts: Sets MAVEN_OPTS. (default: '')
401 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
402 :mvn-version: Version of maven to use. (default: mvn35)
403 :sonar-mvn-goals: Maven goals to run for sonar analysis.
404 (default: sonar:sonar)
405 :sonarcloud: Whether or not to use SonarCloud ``true|false``.
407 :sonarcloud-project-key: SonarCloud project key. (default: '')
408 :sonarcloud-project-organization: SonarCloud project organization.
410 :sonarcloud-api-token: SonarCloud API Token. (default: '')
411 :stream: Keyword that can be used to represent a release code-name.
412 Often the same as the branch. (default: master)
413 :submodule-recursive: Whether to checkout submodules recursively.
415 :submodule-timeout: Timeout (in minutes) for checkout operation.
418 :gerrit_sonar_triggers: Override Gerrit Triggers.
423 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
429 Verify job which runs mvn clean install to test a project build..
433 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
434 - gerrit-maven-verify
435 - github-maven-verify
437 :Comment Trigger: recheck|reverify
439 :Required parameters:
441 :build-node: The node to run build on.
442 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
443 be configured in defaults.yaml)
444 :mvn-settings: The name of settings file containing credentials for the project.
446 :Optional parameters:
448 :branch: Git branch to fetch for the build. (default: master)
449 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
450 :build-timeout: Timeout in minutes before aborting build. (default: 60)
451 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
452 :java-version: Version of Java to use for the build. (default: openjdk8)
453 :mvn-global-settings: The name of the Maven global settings to use for
454 Maven configuration. (default: global-settings)
455 :mvn-opts: Sets MAVEN_OPTS. (default: '')
456 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
457 :mvn-version: Version of maven to use. (default: mvn35)
458 :stream: Keyword that can be used to represent a release code-name.
459 Often the same as the branch. (default: master)
460 :submodule-recursive: Whether to checkout submodules recursively.
462 :submodule-timeout: Timeout (in minutes) for checkout operation.
465 :gerrit_verify_triggers: Override Gerrit Triggers.
466 :gerrit_trigger_file_paths: Override file paths which can be used to
467 filter which file modifications will trigger a build.
469 Maven Verify /w Dependencies
470 ----------------------------
472 Verify job which runs mvn clean install to test a project build /w deps
474 This job can be used to verify a patch in conjunction to all of the
475 upstream patches it depends on. The user of this job can provide a list
480 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
481 - gerrit-maven-verify-dependencies
483 :Comment Trigger: recheck: SPACE_SEPERATED_LIST_OF_PATCHES
485 :Required parameters:
487 :build-node: The node to run build on.
488 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
489 be configured in defaults.yaml)
490 :mvn-settings: The name of settings file containing credentials for the project.
492 :Optional parameters:
494 :branch: Git branch to fetch for the build. (default: master)
495 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
496 :build-timeout: Timeout in minutes before aborting build. (default: 60)
497 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
498 :java-version: Version of Java to use for the build. (default: openjdk8)
499 :mvn-global-settings: The name of the Maven global settings to use for
500 Maven configuration. (default: global-settings)
501 :mvn-opts: Sets MAVEN_OPTS. (default: '')
502 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
503 :mvn-version: Version of maven to use. (default: mvn35)
504 :stream: Keyword that can be used to represent a release code-name.
505 Often the same as the branch. (default: master)
506 :submodule-recursive: Whether to checkout submodules recursively.
508 :submodule-timeout: Timeout (in minutes) for checkout operation.
511 :gerrit_verify_triggers: Override Gerrit Triggers.
512 :gerrit_trigger_file_paths: Override file paths which can be used to
513 filter which file modifications will trigger a build.