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.
69 lf-update-java-alternatives
70 ---------------------------
72 Setup Java alternatives for the Distro.
76 :java-version: Version of Java to set as the default Java.
85 Produces a CLM scan of the code into Nexus IQ Server.
89 - {project-name}-maven-clm-{stream}
93 :Comment Trigger: run-clm
97 :build-node: The node to run build on.
98 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
99 be configured in defaults.yaml)
100 :mvn-settings: The name of settings file containing credentials for the project.
102 :Optional parameters:
104 :branch: The branch to build against. (default: master)
105 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
106 :build-timeout: Timeout in minutes before aborting build. (default: 60)
107 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
108 :java-version: Version of Java to use for the build. (default: openjdk8)
109 :mvn-central: Set to 'true' to also stage to OSSRH. This is for projects
110 that want to release to Maven Central. If set the parameter
111 ``ossrh-profile-id`` also needs to be set. (default: false)
112 :mvn-global-settings: The name of the Maven global settings to use for
113 Maven configuration. (default: global-settings)
114 :mvn-opts: Sets MAVEN_OPTS. (default: '')
115 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
116 :mvn-version: Version of maven to use. (default: mvn35)
117 :nexus-iq-namespace: Insert a namespace to project AppID for projects that
118 share a Nexus IQ system to avoid project name collision. We recommend
119 inserting a trailing - dash if using this parameter.
120 For example 'odl-'. (default: '')
121 :nexus-iq-stage: Stage the policy evaluation will be run against on
122 the Nexus IQ Server. (default: 'build')
123 :ossrh-profile-id: Profile ID for project as provided by OSSRH.
125 :stream: Keyword that can be used to represent a release code-name.
126 Often the same as the branch. (default: master)
127 :submodule-recursive: Whether to checkout submodules recursively.
129 :submodule-timeout: Timeout (in minutes) for checkout operation.
132 :gerrit_merge_triggers: Override Gerrit Triggers.
134 Maven JavaDoc Publish
135 ---------------------
137 Produces and publishes javadocs for a Maven project.
139 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
143 - {project-name}-maven-javadoc-publish-{stream}-{java-version}
144 - gerrit-maven-javadoc-publish
145 - github-maven-javadoc-publish
147 :Comment Trigger: remerge
149 :Required parameters:
151 :build-node: The node to run build on.
152 :javadoc-path: The path in Nexus to deploy javadoc to.
153 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
154 be configured in defaults.yaml)
155 :mvn-settings: The name of settings file containing credentials for the project.
156 :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
157 (Note: This setting should be configured in defaults.yaml.)
159 :Optional parameters:
161 :branch: The branch to build against. (default: master)
162 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
163 :build-timeout: Timeout in minutes before aborting build. (default: 60)
164 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
165 :java-version: Version of Java to use for the build. (default: openjdk8)
166 :mvn-global-settings: The name of the Maven global settings to use for
167 Maven configuration. (default: global-settings)
168 :mvn-opts: Sets MAVEN_OPTS. (default: '')
169 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
170 :mvn-version: Version of maven to use. (default: mvn35)
171 :stream: Keyword that can be used to represent a release code-name.
172 Often the same as the branch. (default: master)
173 :submodule-recursive: Whether to checkout submodules recursively.
175 :submodule-timeout: Timeout (in minutes) for checkout operation.
178 :gerrit_merge_triggers: Override Gerrit Triggers.
183 Produces javadocs for a Maven project.
185 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
189 - {project-name}-maven-javadoc-verify-{stream}-{java-version}
190 - gerrit-maven-javadoc-verify
191 - github-maven-javadoc-verify
193 :Comment Trigger: recheck|reverify
195 :Required parameters:
196 :build-node: The node to run build on.
197 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
198 be configured in defaults.yaml)
199 :mvn-settings: The name of settings file containing credentials for the project.
201 :Optional parameters:
203 :branch: The branch to build against. (default: master)
204 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
205 :build-timeout: Timeout in minutes before aborting build. (default: 60)
206 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
207 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
208 :java-version: Version of Java to use for the build. (default: openjdk8)
209 :mvn-global-settings: The name of the Maven global settings to use for
210 Maven configuration. (default: global-settings)
211 :mvn-opts: Sets MAVEN_OPTS. (default: '')
212 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
213 :mvn-version: Version of maven to use. (default: mvn35)
214 :stream: Keyword that can be used to represent a release code-name.
215 Often the same as the branch. (default: master)
216 :submodule-recursive: Whether to checkout submodules recursively.
218 :submodule-timeout: Timeout (in minutes) for checkout operation.
221 :gerrit_verify_triggers: Override Gerrit Triggers.
226 Merge job which runs `mvn clean deploy` to build a project.
228 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
229 goal to push the upload. This is to get around the issue that Maven deploy does
230 not properly support uploading files at the end of the build and instead pushes
231 as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
234 This job uses the following strategy to deploy jobs to Nexus:
236 1. `wget -r` to fetch maven-metadata.xml from Nexus
237 2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
238 3. Removes untouched maven-metadata.xml files before upload
239 4. Use lftools (cURL) upload script to push artifacts to Nexus
243 - {project-name}-maven-merge-{stream}
247 :Comment Trigger: remerge
249 :Required parameters:
251 :build-node: The node to run build on.
252 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
253 be configured in defaults.yaml)
254 :mvn-settings: The name of settings file containing credentials for the project.
255 :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
256 (Note: This setting should be configured in defaults.yaml.)
257 :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
259 :Optional parameters:
261 :branch: Git branch to fetch for the build. (default: master)
262 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
263 :build-timeout: Timeout in minutes before aborting build. (default: 60)
264 :cron: Cron schedule when to trigger the job. This parameter also
265 supports multiline input via YAML pipe | character in cases where
266 one may want to provide more than 1 cron timer. (default: 'H H * * 0'
268 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
269 :java-version: Version of Java to use for the build. (default: openjdk8)
270 :mvn-global-settings: The name of the Maven global settings to use for
271 Maven configuration. (default: global-settings)
272 :mvn-opts: Sets MAVEN_OPTS. (default: '')
273 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
274 :mvn-version: Version of maven to use. (default: mvn35)
275 :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
276 :stream: Keyword that can be used to represent a release code-name.
277 Often the same as the branch. (default: master)
278 :submodule-recursive: Whether to checkout submodules recursively.
280 :submodule-timeout: Timeout (in minutes) for checkout operation.
283 :gerrit_merge_triggers: Override Gerrit Triggers.
284 :gerrit_trigger_file_paths: Override file paths which can be used to
285 filter which file modifications will trigger a build.
290 Produces a release candidate by creating a staging repo in Nexus.
292 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
293 "autorelease-2000", "odlparent-1201", etc...
295 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
296 directory is then used later to deploy to Nexus.
300 - {project-name}-maven-stage-{stream}
304 :Required parameters:
306 :build-node: The node to run build on.
307 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
308 be configured in defaults.yaml)
309 :mvn-settings: The name of settings file containing credentials for the project.
310 :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
311 (Note: This setting should be configured in defaults.yaml.)
312 :staging-profile-id: Profile ID of the project's Nexus staging profile.
314 :Optional parameters:
316 :archive-artifacts: Artifacts to archive to the logs server (default: '').
317 :branch: The branch to build against. (default: master)
318 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
319 :build-timeout: Timeout in minutes before aborting build. (default: 60)
320 :cron: Cron schedule when to trigger the job. This parameter also
321 supports multiline input via YAML pipe | character in cases where
322 one may want to provide more than 1 cron timer. (default: '')
323 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
324 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
325 :java-version: Version of Java to use for the build. (default: openjdk8)
326 :mvn-global-settings: The name of the Maven global settings to use for
327 Maven configuration. (default: global-settings)
328 :mvn-opts: Sets MAVEN_OPTS. (default: '')
329 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
330 :mvn-version: Version of maven to use. (default: mvn35)
331 :sign-artifacts: Sign artifacts with Sigul. (default: false)
332 :stream: Keyword that can be used to represent a release code-name.
333 Often the same as the branch. (default: master)
334 :submodule-recursive: Whether to checkout submodules recursively.
336 :submodule-timeout: Timeout (in minutes) for checkout operation.
339 :gerrit_release_triggers: Override Gerrit Triggers.
346 Sonar job which runs mvn clean install then publishes to Sonar.
348 This job purposely only runs on the master branch as there are Additional
349 configuration needed to support multiple branches and there's not much
350 interest in that kind of support.
354 - {project-name}-sonar
358 :Comment Trigger: run-sonar
360 :Required parameters:
362 :build-node: The node to run build on.
363 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
364 be configured in defaults.yaml)
365 :mvn-settings: The name of settings file containing credentials for the project.
367 :Optional parameters:
369 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
370 :build-timeout: Timeout in minutes before aborting build. (default: 60)
371 :cron: Cron schedule when to trigger the job. This parameter also
372 supports multiline input via YAML pipe | character in cases where
373 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
375 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
376 :java-version: Version of Java to use for the build. (default: openjdk8)
377 :mvn-global-settings: The name of the Maven global settings to use for
378 Maven configuration. (default: global-settings)
379 :mvn-opts: Sets MAVEN_OPTS. (default: '')
380 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
381 :mvn-version: Version of maven to use. (default: mvn35)
382 :sonar-mvn-goals: Maven goals to run for sonar analysis.
383 (default: sonar:sonar)
384 :sonarcloud: Whether or not to use SonarCloud ``true|false``.
386 :sonarcloud-project-key: SonarCloud project key. (default: '')
387 :sonarcloud-project-organization: SonarCloud project organization.
389 :sonarcloud-api-token: SonarCloud API Token. (default: '')
390 :stream: Keyword that can be used to represent a release code-name.
391 Often the same as the branch. (default: master)
392 :submodule-recursive: Whether to checkout submodules recursively.
394 :submodule-timeout: Timeout (in minutes) for checkout operation.
397 :gerrit_sonar_triggers: Override Gerrit Triggers.
402 .. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml
408 Verify job which runs mvn clean install to test a project build..
412 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
413 - gerrit-maven-verify
414 - github-maven-verify
416 :Comment Trigger: recheck|reverify
418 :Required parameters:
420 :build-node: The node to run build on.
421 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
422 be configured in defaults.yaml)
423 :mvn-settings: The name of settings file containing credentials for the project.
425 :Optional parameters:
427 :branch: Git branch to fetch for the build. (default: master)
428 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
429 :build-timeout: Timeout in minutes before aborting build. (default: 60)
430 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
431 :java-version: Version of Java to use for the build. (default: openjdk8)
432 :mvn-global-settings: The name of the Maven global settings to use for
433 Maven configuration. (default: global-settings)
434 :mvn-opts: Sets MAVEN_OPTS. (default: '')
435 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
436 :mvn-version: Version of maven to use. (default: mvn35)
437 :stream: Keyword that can be used to represent a release code-name.
438 Often the same as the branch. (default: master)
439 :submodule-recursive: Whether to checkout submodules recursively.
441 :submodule-timeout: Timeout (in minutes) for checkout operation.
444 :gerrit_verify_triggers: Override Gerrit Triggers.
445 :gerrit_trigger_file_paths: Override file paths which can be used to
446 filter which file modifications will trigger a build.
448 Maven Verify /w Dependencies
449 ----------------------------
451 Verify job which runs mvn clean install to test a project build /w deps
453 This job can be used to verify a patch in conjunction to all of the
454 upstream patches it depends on. The user of this job can provide a list
459 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
460 - gerrit-maven-verify-dependencies
462 :Comment Trigger: recheck: SPACE_SEPERATED_LIST_OF_PATCHES
464 :Required parameters:
466 :build-node: The node to run build on.
467 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
468 be configured in defaults.yaml)
469 :mvn-settings: The name of settings file containing credentials for the project.
471 :Optional parameters:
473 :branch: Git branch to fetch for the build. (default: master)
474 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
475 :build-timeout: Timeout in minutes before aborting build. (default: 60)
476 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
477 :java-version: Version of Java to use for the build. (default: openjdk8)
478 :mvn-global-settings: The name of the Maven global settings to use for
479 Maven configuration. (default: global-settings)
480 :mvn-opts: Sets MAVEN_OPTS. (default: '')
481 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
482 :mvn-version: Version of maven to use. (default: mvn35)
483 :stream: Keyword that can be used to represent a release code-name.
484 Often the same as the branch. (default: master)
485 :submodule-recursive: Whether to checkout submodules recursively.
487 :submodule-timeout: Timeout (in minutes) for checkout operation.
490 :gerrit_verify_triggers: Override Gerrit Triggers.
491 :gerrit_trigger_file_paths: Override file paths which can be used to
492 filter which file modifications will trigger a build.