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.
33 Calls the maven build script to perform a maven build.
37 :mvn-goals: The maven goals to perform for the build.
38 (default: clean deploy)
43 Common Jenkins configuration for Maven jobs.
48 Calls the maven deploy script to push artifacts to Nexus.
53 Calls the maven stage script to push artifacts to a Nexus staging repository.
55 lf-update-java-alternatives
56 ---------------------------
58 Setup Java alternatives for the Distro.
62 :java-version: Version of Java to set as the default Java.
71 Produces a CLM scan of the code into Nexus IQ Server.
75 - {project-name}-maven-clm-{stream}
79 :Comment Trigger: run-clm
83 :build-node: The node to run build on.
84 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
85 be configured in defaults.yaml)
86 :mvn-settings: The name of settings file containing credentials for the project.
90 :branch: The branch to build against. (default: master)
91 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
92 :build-timeout: Timeout in minutes before aborting build. (default: 60)
93 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
94 :java-version: Version of Java to use for the build. (default: openjdk8)
95 :mvn-central: Set to 'true' to also stage to OSSRH. This is for projects
96 that want to release to Maven Central. If set the parameter
97 ``ossrh-profile-id`` also needs to be set. (default: false)
98 :mvn-global-settings: The name of the Maven global settings to use for
99 Maven configuration. (default: global-settings)
100 :mvn-opts: Sets MAVEN_OPTS. (default: '')
101 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
102 :mvn-version: Version of maven to use. (default: mvn35)
103 :nexus-iq-namespace: Insert a namespace to project AppID for projects that
104 share a Nexus IQ system to avoid project name collision. We recommend
105 inserting a trailing - dash if using this parameter.
106 For example 'odl-'. (default: '')
107 :nexus-iq-stage: Stage the policy evaluation will be run against on
108 the Nexus IQ Server. (default: 'build')
109 :ossrh-profile-id: Profile ID for project as provided by OSSRH.
111 :stream: Keyword that can be used to represent a release code-name.
112 Often the same as the branch. (default: master)
113 :submodule-recursive: Whether to checkout submodules recursively.
115 :submodule-timeout: Timeout (in minutes) for checkout operation.
118 :gerrit_merge_triggers: Override Gerrit Triggers.
120 Maven JavaDoc Publish
121 ---------------------
123 Produces and publishes javadocs for a Maven project.
125 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
129 - {project-name}-maven-javadoc-publish-{stream}
130 - gerrit-maven-javadoc-publish
131 - github-maven-javadoc-publish
133 :Comment Trigger: remerge
135 :Required parameters:
137 :build-node: The node to run build on.
138 :javadoc-path: The path in Nexus to deploy javadoc to.
139 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
140 be configured in defaults.yaml)
141 :mvn-settings: The name of settings file containing credentials for the project.
142 :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
143 (Note: This setting should be configured in defaults.yaml.)
145 :Optional parameters:
147 :branch: The branch to build against. (default: master)
148 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
149 :build-timeout: Timeout in minutes before aborting build. (default: 60)
150 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
151 :java-version: Version of Java to use for the build. (default: openjdk8)
152 :mvn-global-settings: The name of the Maven global settings to use for
153 Maven configuration. (default: global-settings)
154 :mvn-opts: Sets MAVEN_OPTS. (default: '')
155 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
156 :mvn-version: Version of maven to use. (default: mvn35)
157 :stream: Keyword that can be used to represent a release code-name.
158 Often the same as the branch. (default: master)
159 :submodule-recursive: Whether to checkout submodules recursively.
161 :submodule-timeout: Timeout (in minutes) for checkout operation.
164 :gerrit_merge_triggers: Override Gerrit Triggers.
169 Produces javadocs for a Maven project.
171 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
175 - {project-name}-maven-javadoc-verify-{stream}
176 - gerrit-maven-javadoc-verify
177 - github-maven-javadoc-verify
179 :Comment Trigger: recheck|reverify
181 :Required parameters:
182 :build-node: The node to run build on.
183 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
184 be configured in defaults.yaml)
185 :mvn-settings: The name of settings file containing credentials for the project.
187 :Optional parameters:
189 :branch: The branch to build against. (default: master)
190 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
191 :build-timeout: Timeout in minutes before aborting build. (default: 60)
192 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
193 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
194 :java-version: Version of Java to use for the build. (default: openjdk8)
195 :mvn-global-settings: The name of the Maven global settings to use for
196 Maven configuration. (default: global-settings)
197 :mvn-opts: Sets MAVEN_OPTS. (default: '')
198 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
199 :mvn-version: Version of maven to use. (default: mvn35)
200 :stream: Keyword that can be used to represent a release code-name.
201 Often the same as the branch. (default: master)
202 :submodule-recursive: Whether to checkout submodules recursively.
204 :submodule-timeout: Timeout (in minutes) for checkout operation.
207 :gerrit_verify_triggers: Override Gerrit Triggers.
212 Merge job which runs `mvn clean deploy` to build a project.
214 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
215 goal to push the upload. This is to get around the issue that Maven deploy does
216 not properly support uploading files at the end of the build and instead pushes
217 as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
220 This job uses the following strategy to deploy jobs to Nexus:
222 1. `wget -r` to fetch maven-metadata.xml from Nexus
223 2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
224 3. Removes untouched maven-metadata.xml files before upload
225 4. Use lftools (cURL) upload script to push artifacts to Nexus
229 - {project-name}-maven-merge-{stream}
233 :Comment Trigger: remerge
235 :Required parameters:
237 :build-node: The node to run build on.
238 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
239 be configured in defaults.yaml)
240 :mvn-settings: The name of settings file containing credentials for the project.
241 :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
242 (Note: This setting should be configured in defaults.yaml.)
243 :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
245 :Optional parameters:
247 :branch: Git branch to fetch for the build. (default: master)
248 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
249 :build-timeout: Timeout in minutes before aborting build. (default: 60)
250 :cron: Cron schedule when to trigger the job. This parameter also
251 supports multiline input via YAML pipe | character in cases where
252 one may want to provide more than 1 cron timer. (default: 'H H * * 0'
254 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
255 :java-version: Version of Java to use for the build. (default: openjdk8)
256 :mvn-global-settings: The name of the Maven global settings to use for
257 Maven configuration. (default: global-settings)
258 :mvn-opts: Sets MAVEN_OPTS. (default: '')
259 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
260 :mvn-version: Version of maven to use. (default: mvn35)
261 :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
262 :stream: Keyword that can be used to represent a release code-name.
263 Often the same as the branch. (default: master)
264 :submodule-recursive: Whether to checkout submodules recursively.
266 :submodule-timeout: Timeout (in minutes) for checkout operation.
269 :gerrit_merge_triggers: Override Gerrit Triggers.
270 :gerrit_trigger_file_paths: Override file paths which can be used to
271 filter which file modifications will trigger a build.
276 Produces a release candidate by creating a staging repo in Nexus.
278 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
279 "autorelease-2000", "odlparent-1201", etc...
281 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
282 directory is then used later to deploy to Nexus.
286 - {project-name}-maven-stage-{stream}
290 :Required parameters:
292 :build-node: The node to run build on.
293 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
294 be configured in defaults.yaml)
295 :mvn-settings: The name of settings file containing credentials for the project.
296 :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
297 (Note: This setting should be configured in defaults.yaml.)
298 :staging-profile-id: Profile ID of the project's Nexus staging profile.
300 :Optional parameters:
302 :archive-artifacts: Artifacts to archive to the logs server (default: '').
303 :branch: The branch to build against. (default: master)
304 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
305 :build-timeout: Timeout in minutes before aborting build. (default: 60)
306 :cron: Cron schedule when to trigger the job. This parameter also
307 supports multiline input via YAML pipe | character in cases where
308 one may want to provide more than 1 cron timer. (default: '')
309 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
310 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
311 :java-version: Version of Java to use for the build. (default: openjdk8)
312 :mvn-global-settings: The name of the Maven global settings to use for
313 Maven configuration. (default: global-settings)
314 :mvn-opts: Sets MAVEN_OPTS. (default: '')
315 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
316 :mvn-version: Version of maven to use. (default: mvn35)
317 :sign-artifacts: Sign artifacts with Sigul. (default: false)
318 :stream: Keyword that can be used to represent a release code-name.
319 Often the same as the branch. (default: master)
320 :submodule-recursive: Whether to checkout submodules recursively.
322 :submodule-timeout: Timeout (in minutes) for checkout operation.
325 :gerrit_release_triggers: Override Gerrit Triggers.
330 Sonar job which runs mvn clean install then publishes to Sonar.
332 This job purposely only runs on the master branch as there are Additional
333 configuration needed to support multiple branches and there's not much
334 interest in that kind of support.
338 - {project-name}-sonar
342 :Comment Trigger: run-sonar
344 :Required parameters:
346 :build-node: The node to run build on.
347 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
348 be configured in defaults.yaml)
349 :mvn-settings: The name of settings file containing credentials for the project.
351 :Optional parameters:
353 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
354 :build-timeout: Timeout in minutes before aborting build. (default: 60)
355 :cron: Cron schedule when to trigger the job. This parameter also
356 supports multiline input via YAML pipe | character in cases where
357 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
359 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
360 :java-version: Version of Java to use for the build. (default: openjdk8)
361 :mvn-global-settings: The name of the Maven global settings to use for
362 Maven configuration. (default: global-settings)
363 :mvn-opts: Sets MAVEN_OPTS. (default: '')
364 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
365 :mvn-version: Version of maven to use. (default: mvn35)
366 :stream: Keyword that can be used to represent a release code-name.
367 Often the same as the branch. (default: master)
368 :submodule-recursive: Whether to checkout submodules recursively.
370 :submodule-timeout: Timeout (in minutes) for checkout operation.
373 :gerrit_sonar_triggers: Override Gerrit Triggers.
378 Verify job which runs mvn clean install to test a project build..
382 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
383 - gerrit-maven-verify
384 - github-maven-verify
386 :Comment Trigger: recheck|reverify
388 :Required parameters:
390 :build-node: The node to run build on.
391 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
392 be configured in defaults.yaml)
393 :mvn-settings: The name of settings file containing credentials for the project.
395 :Optional parameters:
397 :branch: Git branch to fetch for the build. (default: master)
398 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
399 :build-timeout: Timeout in minutes before aborting build. (default: 60)
400 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
401 :java-version: Version of Java to use for the build. (default: openjdk8)
402 :mvn-global-settings: The name of the Maven global settings to use for
403 Maven configuration. (default: global-settings)
404 :mvn-opts: Sets MAVEN_OPTS. (default: '')
405 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
406 :mvn-version: Version of maven to use. (default: mvn35)
407 :stream: Keyword that can be used to represent a release code-name.
408 Often the same as the branch. (default: master)
409 :submodule-recursive: Whether to checkout submodules recursively.
411 :submodule-timeout: Timeout (in minutes) for checkout operation.
414 :gerrit_verify_triggers: Override Gerrit Triggers.
415 :gerrit_trigger_file_paths: Override file paths which can be used to
416 filter which file modifications will trigger a build.
418 Maven Verify /w Dependencies
419 ----------------------------
421 Verify job which runs mvn clean install to test a project build /w deps
423 This job can be used to verify a patch in conjunction to all of the
424 upstream patches it depends on. The user of this job can provide a list
429 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
430 - gerrit-maven-verify-dependencies
432 :Comment Trigger: recheck: SPACE_SEPERATED_LIST_OF_PATCHES
434 :Required parameters:
436 :build-node: The node to run build on.
437 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
438 be configured in defaults.yaml)
439 :mvn-settings: The name of settings file containing credentials for the project.
441 :Optional parameters:
443 :branch: Git branch to fetch for the build. (default: master)
444 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
445 :build-timeout: Timeout in minutes before aborting build. (default: 60)
446 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
447 :java-version: Version of Java to use for the build. (default: openjdk8)
448 :mvn-global-settings: The name of the Maven global settings to use for
449 Maven configuration. (default: global-settings)
450 :mvn-opts: Sets MAVEN_OPTS. (default: '')
451 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
452 :mvn-version: Version of maven to use. (default: mvn35)
453 :stream: Keyword that can be used to represent a release code-name.
454 Often the same as the branch. (default: master)
455 :submodule-recursive: Whether to checkout submodules recursively.
457 :submodule-timeout: Timeout (in minutes) for checkout operation.
460 :gerrit_verify_triggers: Override Gerrit Triggers.
461 :gerrit_trigger_file_paths: Override file paths which can be used to
462 filter which file modifications will trigger a build.