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.
67 Calls the maven stage script to push artifacts to a Nexus staging repository.
71 :mvn-global-settings: The name of the Maven global settings to use for
73 :mvn-settings: The name of settings file containing credentials for the project.
75 lf-update-java-alternatives
76 ---------------------------
78 Setup Java alternatives for the Distro.
82 :java-version: Version of Java to set as the default Java.
91 Produces a CLM scan of the code into Nexus IQ Server.
95 - {project-name}-maven-clm-{stream}
99 :Comment Trigger: run-clm
101 :Required parameters:
103 :build-node: The node to run build on.
104 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
105 be configured in defaults.yaml)
106 :mvn-settings: The name of settings file containing credentials for the project.
108 :Optional parameters:
110 :branch: The branch to build against. (default: master)
111 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
112 :build-timeout: Timeout in minutes before aborting build. (default: 60)
113 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
114 :java-version: Version of Java to use for the build. (default: openjdk8)
115 :mvn-central: Set to 'true' to also stage to OSSRH. This is for projects
116 that want to release to Maven Central. If set the parameter
117 ``ossrh-profile-id`` also needs to be set. (default: false)
118 :mvn-global-settings: The name of the Maven global settings to use for
119 Maven configuration. (default: global-settings)
120 :mvn-opts: Sets MAVEN_OPTS. (default: '')
121 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
122 :mvn-version: Version of maven to use. (default: mvn35)
123 :nexus-iq-namespace: Insert a namespace to project AppID for projects that
124 share a Nexus IQ system to avoid project name collision. We recommend
125 inserting a trailing - dash if using this parameter.
126 For example 'odl-'. (default: '')
127 :nexus-iq-stage: Stage the policy evaluation will be run against on
128 the Nexus IQ Server. (default: 'build')
129 :ossrh-profile-id: Profile ID for project as provided by OSSRH.
131 :stream: Keyword that can be used to represent a release code-name.
132 Often the same as the branch. (default: master)
133 :submodule-recursive: Whether to checkout submodules recursively.
135 :submodule-timeout: Timeout (in minutes) for checkout operation.
138 :gerrit_merge_triggers: Override Gerrit Triggers.
140 Maven JavaDoc Publish
141 ---------------------
143 Produces and publishes javadocs for a Maven project.
145 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
149 - {project-name}-maven-javadoc-publish-{stream}-{java-version}
150 - gerrit-maven-javadoc-publish
151 - github-maven-javadoc-publish
153 :Comment Trigger: remerge
155 :Required parameters:
157 :build-node: The node to run build on.
158 :javadoc-path: The path in Nexus to deploy javadoc to.
159 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
160 be configured in defaults.yaml)
161 :mvn-settings: The name of settings file containing credentials for the project.
162 :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
163 (Note: This setting should be configured in defaults.yaml.)
165 :Optional parameters:
167 :branch: The branch to build against. (default: master)
168 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
169 :build-timeout: Timeout in minutes before aborting build. (default: 60)
170 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
171 :java-version: Version of Java to use for the build. (default: openjdk8)
172 :mvn-global-settings: The name of the Maven global settings to use for
173 Maven configuration. (default: global-settings)
174 :mvn-opts: Sets MAVEN_OPTS. (default: '')
175 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
176 :mvn-version: Version of maven to use. (default: mvn35)
177 :stream: Keyword that can be used to represent a release code-name.
178 Often the same as the branch. (default: master)
179 :submodule-recursive: Whether to checkout submodules recursively.
181 :submodule-timeout: Timeout (in minutes) for checkout operation.
184 :gerrit_merge_triggers: Override Gerrit Triggers.
189 Produces javadocs for a Maven project.
191 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
195 - {project-name}-maven-javadoc-verify-{stream}-{java-version}
196 - gerrit-maven-javadoc-verify
197 - github-maven-javadoc-verify
199 :Comment Trigger: recheck|reverify
201 :Required parameters:
202 :build-node: The node to run build on.
203 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
204 be configured in defaults.yaml)
205 :mvn-settings: The name of settings file containing credentials for the project.
207 :Optional parameters:
209 :branch: The branch to build against. (default: master)
210 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
211 :build-timeout: Timeout in minutes before aborting build. (default: 60)
212 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
213 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
214 :java-version: Version of Java to use for the build. (default: openjdk8)
215 :mvn-global-settings: The name of the Maven global settings to use for
216 Maven configuration. (default: global-settings)
217 :mvn-opts: Sets MAVEN_OPTS. (default: '')
218 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
219 :mvn-version: Version of maven to use. (default: mvn35)
220 :stream: Keyword that can be used to represent a release code-name.
221 Often the same as the branch. (default: master)
222 :submodule-recursive: Whether to checkout submodules recursively.
224 :submodule-timeout: Timeout (in minutes) for checkout operation.
227 :gerrit_verify_triggers: Override Gerrit Triggers.
232 Merge job which runs `mvn clean deploy` to build a project.
234 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
235 goal to push the upload. This is to get around the issue that Maven deploy does
236 not properly support uploading files at the end of the build and instead pushes
237 as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
240 This job uses the following strategy to deploy jobs to Nexus:
242 1. `wget -r` to fetch maven-metadata.xml from Nexus
243 2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
244 3. Removes untouched maven-metadata.xml files before upload
245 4. Use lftools (cURL) upload script to push artifacts to Nexus
249 - {project-name}-maven-merge-{stream}
253 :Comment Trigger: remerge
255 :Required parameters:
257 :build-node: The node to run build on.
258 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
259 be configured in defaults.yaml)
260 :mvn-settings: The name of settings file containing credentials for the project.
261 :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
262 (Note: This setting should be configured in defaults.yaml.)
263 :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
265 :Optional parameters:
267 :branch: Git branch to fetch for the build. (default: master)
268 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
269 :build-timeout: Timeout in minutes before aborting build. (default: 60)
270 :cron: Cron schedule when to trigger the job. This parameter also
271 supports multiline input via YAML pipe | character in cases where
272 one may want to provide more than 1 cron timer. (default: 'H H * * 0'
274 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
275 :java-version: Version of Java to use for the build. (default: openjdk8)
276 :mvn-global-settings: The name of the Maven global settings to use for
277 Maven configuration. (default: global-settings)
278 :mvn-opts: Sets MAVEN_OPTS. (default: '')
279 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
280 :mvn-version: Version of maven to use. (default: mvn35)
281 :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
282 :stream: Keyword that can be used to represent a release code-name.
283 Often the same as the branch. (default: master)
284 :submodule-recursive: Whether to checkout submodules recursively.
286 :submodule-timeout: Timeout (in minutes) for checkout operation.
289 :gerrit_merge_triggers: Override Gerrit Triggers.
290 :gerrit_trigger_file_paths: Override file paths which can be used to
291 filter which file modifications will trigger a build.
296 Produces a release candidate by creating a staging repo in Nexus.
298 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
299 "autorelease-2000", "odlparent-1201", etc...
301 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
302 directory is then used later to deploy to Nexus.
306 - {project-name}-maven-stage-{stream}
310 :Required parameters:
312 :build-node: The node to run build on.
313 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
314 be configured in defaults.yaml)
315 :mvn-settings: The name of settings file containing credentials for the project.
316 :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
317 (Note: This setting should be configured in defaults.yaml.)
318 :staging-profile-id: Profile ID of the project's Nexus staging profile.
320 :Optional parameters:
322 :archive-artifacts: Artifacts to archive to the logs server (default: '').
323 :branch: The branch to build against. (default: master)
324 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
325 :build-timeout: Timeout in minutes before aborting build. (default: 60)
326 :cron: Cron schedule when to trigger the job. This parameter also
327 supports multiline input via YAML pipe | character in cases where
328 one may want to provide more than 1 cron timer. (default: '')
329 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
330 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
331 :java-version: Version of Java to use for the build. (default: openjdk8)
332 :mvn-global-settings: The name of the Maven global settings to use for
333 Maven configuration. (default: global-settings)
334 :mvn-opts: Sets MAVEN_OPTS. (default: '')
335 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
336 :mvn-version: Version of maven to use. (default: mvn35)
337 :sign-artifacts: Sign artifacts with Sigul. (default: false)
338 :stream: Keyword that can be used to represent a release code-name.
339 Often the same as the branch. (default: master)
340 :submodule-recursive: Whether to checkout submodules recursively.
342 :submodule-timeout: Timeout (in minutes) for checkout operation.
345 :gerrit_release_triggers: Override Gerrit Triggers.
352 Sonar job which runs mvn clean install then publishes to Sonar.
354 This job purposely only runs on the master branch as there are Additional
355 configuration needed to support multiple branches and there's not much
356 interest in that kind of support.
360 - {project-name}-sonar
364 :Comment Trigger: run-sonar
366 :Required parameters:
368 :build-node: The node to run build on.
369 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
370 be configured in defaults.yaml)
371 :mvn-settings: The name of settings file containing credentials for the project.
373 :Optional parameters:
375 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
376 :build-timeout: Timeout in minutes before aborting build. (default: 60)
377 :cron: Cron schedule when to trigger the job. This parameter also
378 supports multiline input via YAML pipe | character in cases where
379 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
381 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
382 :java-version: Version of Java to use for the build. (default: openjdk8)
383 :mvn-global-settings: The name of the Maven global settings to use for
384 Maven configuration. (default: global-settings)
385 :mvn-opts: Sets MAVEN_OPTS. (default: '')
386 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
387 :mvn-version: Version of maven to use. (default: mvn35)
388 :sonar-mvn-goals: Maven goals to run for sonar analysis.
389 (default: sonar:sonar)
390 :sonarcloud: Whether or not to use SonarCloud ``true|false``.
392 :sonarcloud-project-key: SonarCloud project key. (default: '')
393 :sonarcloud-project-organization: SonarCloud project organization.
395 :sonarcloud-api-token: SonarCloud API Token. (default: '')
396 :stream: Keyword that can be used to represent a release code-name.
397 Often the same as the branch. (default: master)
398 :submodule-recursive: Whether to checkout submodules recursively.
400 :submodule-timeout: Timeout (in minutes) for checkout operation.
403 :gerrit_sonar_triggers: Override Gerrit Triggers.
408 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
414 Verify job which runs mvn clean install to test a project build..
418 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
419 - gerrit-maven-verify
420 - github-maven-verify
422 :Comment Trigger: recheck|reverify
424 :Required parameters:
426 :build-node: The node to run build on.
427 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
428 be configured in defaults.yaml)
429 :mvn-settings: The name of settings file containing credentials for the project.
431 :Optional parameters:
433 :branch: Git branch to fetch for the build. (default: master)
434 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
435 :build-timeout: Timeout in minutes before aborting build. (default: 60)
436 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
437 :java-version: Version of Java to use for the build. (default: openjdk8)
438 :mvn-global-settings: The name of the Maven global settings to use for
439 Maven configuration. (default: global-settings)
440 :mvn-opts: Sets MAVEN_OPTS. (default: '')
441 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
442 :mvn-version: Version of maven to use. (default: mvn35)
443 :stream: Keyword that can be used to represent a release code-name.
444 Often the same as the branch. (default: master)
445 :submodule-recursive: Whether to checkout submodules recursively.
447 :submodule-timeout: Timeout (in minutes) for checkout operation.
450 :gerrit_verify_triggers: Override Gerrit Triggers.
451 :gerrit_trigger_file_paths: Override file paths which can be used to
452 filter which file modifications will trigger a build.
454 Maven Verify /w Dependencies
455 ----------------------------
457 Verify job which runs mvn clean install to test a project build /w deps
459 This job can be used to verify a patch in conjunction to all of the
460 upstream patches it depends on. The user of this job can provide a list
465 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
466 - gerrit-maven-verify-dependencies
468 :Comment Trigger: recheck: SPACE_SEPERATED_LIST_OF_PATCHES
470 :Required parameters:
472 :build-node: The node to run build on.
473 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
474 be configured in defaults.yaml)
475 :mvn-settings: The name of settings file containing credentials for the project.
477 :Optional parameters:
479 :branch: Git branch to fetch for the build. (default: master)
480 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
481 :build-timeout: Timeout in minutes before aborting build. (default: 60)
482 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
483 :java-version: Version of Java to use for the build. (default: openjdk8)
484 :mvn-global-settings: The name of the Maven global settings to use for
485 Maven configuration. (default: global-settings)
486 :mvn-opts: Sets MAVEN_OPTS. (default: '')
487 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
488 :mvn-version: Version of maven to use. (default: mvn35)
489 :stream: Keyword that can be used to represent a release code-name.
490 Often the same as the branch. (default: master)
491 :submodule-recursive: Whether to checkout submodules recursively.
493 :submodule-timeout: Timeout (in minutes) for checkout operation.
496 :gerrit_verify_triggers: Override Gerrit Triggers.
497 :gerrit_trigger_file_paths: Override file paths which can be used to
498 filter which file modifications will trigger a build.