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-global-settings: The name of the Maven global settings to use for
96 Maven configuration. (default: global-settings)
97 :mvn-opts: Sets MAVEN_OPTS. (default: '')
98 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
99 :mvn-version: Version of maven to use. (default: mvn35)
100 :nexus-iq-stage: Stage the policy evaluation will be run against on
101 the Nexus IQ Server. (default: 'build')
102 :stream: Keyword that can be used to represent a release code-name.
103 Often the same as the branch. (default: master)
104 :submodule-recursive: Whether to checkout submodules recursively.
107 :gerrit_merge_triggers: Override Gerrit Triggers.
109 Maven JavaDoc Publish
110 ---------------------
112 Produces and publishes javadocs for a Maven project.
114 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
118 - {project-name}-maven-javadoc-publish-{stream}
119 - gerrit-maven-javadoc-publish
120 - github-maven-javadoc-publish
122 :Comment Trigger: remerge
124 :Required parameters:
126 :build-node: The node to run build on.
127 :javadoc-path: The path in Nexus to deploy javadoc to.
128 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
129 be configured in defaults.yaml)
130 :mvn-settings: The name of settings file containing credentials for the project.
131 :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
132 (Note: This setting should be configured in defaults.yaml.)
134 :Optional parameters:
136 :branch: The branch to build against. (default: master)
137 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
138 :build-timeout: Timeout in minutes before aborting build. (default: 60)
139 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
140 :java-version: Version of Java to use for the build. (default: openjdk8)
141 :mvn-global-settings: The name of the Maven global settings to use for
142 Maven configuration. (default: global-settings)
143 :mvn-opts: Sets MAVEN_OPTS. (default: '')
144 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
145 :mvn-version: Version of maven to use. (default: mvn35)
146 :stream: Keyword that can be used to represent a release code-name.
147 Often the same as the branch. (default: master)
148 :submodule-recursive: Whether to checkout submodules recursively.
151 :gerrit_merge_triggers: Override Gerrit Triggers.
156 Produces javadocs for a Maven project.
158 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
162 - {project-name}-maven-javadoc-verify-{stream}
163 - gerrit-maven-javadoc-verify
164 - github-maven-javadoc-verify
166 :Comment Trigger: recheck|reverify
168 :Required parameters:
169 :build-node: The node to run build on.
170 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
171 be configured in defaults.yaml)
172 :mvn-settings: The name of settings file containing credentials for the project.
174 :Optional parameters:
176 :branch: The branch to build against. (default: master)
177 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
178 :build-timeout: Timeout in minutes before aborting build. (default: 60)
179 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
180 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
181 :java-version: Version of Java to use for the build. (default: openjdk8)
182 :mvn-global-settings: The name of the Maven global settings to use for
183 Maven configuration. (default: global-settings)
184 :mvn-opts: Sets MAVEN_OPTS. (default: '')
185 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
186 :mvn-version: Version of maven to use. (default: mvn35)
187 :stream: Keyword that can be used to represent a release code-name.
188 Often the same as the branch. (default: master)
189 :submodule-recursive: Whether to checkout submodules recursively.
192 :gerrit_verify_triggers: Override Gerrit Triggers.
197 Merge job which runs `mvn clean deploy` to build a project.
199 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
200 goal to push the upload. This is to get around the issue that Maven deploy does
201 not properly support uploading files at the end of the build and instead pushes
202 as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
205 This job uses the following strategy to deploy jobs to Nexus:
207 1. `wget -r` to fetch maven-metadata.xml from Nexus
208 2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
209 3. Removes untouched maven-metadata.xml files before upload
210 4. Use lftools (cURL) upload script to push artifacts to Nexus
214 - {project-name}-maven-merge-{stream}
218 :Comment Trigger: remerge
220 :Required parameters:
222 :build-node: The node to run build on.
223 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
224 be configured in defaults.yaml)
225 :mvn-settings: The name of settings file containing credentials for the project.
226 :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
227 (Note: This setting should be configured in defaults.yaml.)
228 :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
230 :Optional parameters:
232 :branch: Git branch to fetch for the build. (default: master)
233 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
234 :build-timeout: Timeout in minutes before aborting build. (default: 60)
235 :cron: Cron schedule when to trigger the job. This parameter also
236 supports multiline input via YAML pipe | character in cases where
237 one may want to provide more than 1 cron timer. (default: 'H H * * 0'
239 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
240 :java-version: Version of Java to use for the build. (default: openjdk8)
241 :mvn-global-settings: The name of the Maven global settings to use for
242 Maven configuration. (default: global-settings)
243 :mvn-opts: Sets MAVEN_OPTS. (default: '')
244 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
245 :mvn-version: Version of maven to use. (default: mvn35)
246 :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
247 :stream: Keyword that can be used to represent a release code-name.
248 Often the same as the branch. (default: master)
249 :submodule-recursive: Whether to checkout submodules recursively.
252 :gerrit_merge_triggers: Override Gerrit Triggers.
253 :gerrit_trigger_file_paths: Override file paths which can be used to
254 filter which file modifications will trigger a build.
259 Produces a release candidate by creating a staging repo in Nexus.
261 The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
262 "autorelease-2000", "odlparent-1201", etc...
264 This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
265 directory is then used later to deploy to Nexus.
269 - {project-name}-maven-stage-{stream}
273 :Required parameters:
275 :build-node: The node to run build on.
276 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
277 be configured in defaults.yaml)
278 :mvn-settings: The name of settings file containing credentials for the project.
279 :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
280 (Note: This setting should be configured in defaults.yaml.)
281 :staging-profile-id: Profile ID of the project's Nexus staging profile.
283 :Optional parameters:
285 :archive-artifacts: Artifacts to archive to the logs server (default: '').
286 :branch: The branch to build against. (default: master)
287 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
288 :build-timeout: Timeout in minutes before aborting build. (default: 60)
289 :cron: Cron schedule when to trigger the job. This parameter also
290 supports multiline input via YAML pipe | character in cases where
291 one may want to provide more than 1 cron timer. (default: '')
292 :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
293 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
294 :java-version: Version of Java to use for the build. (default: openjdk8)
295 :mvn-global-settings: The name of the Maven global settings to use for
296 Maven configuration. (default: global-settings)
297 :mvn-opts: Sets MAVEN_OPTS. (default: '')
298 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
299 :mvn-version: Version of maven to use. (default: mvn35)
300 :stream: Keyword that can be used to represent a release code-name.
301 Often the same as the branch. (default: master)
302 :submodule-recursive: Whether to checkout submodules recursively.
305 :gerrit_release_triggers: Override Gerrit Triggers.
310 Sonar job which runs mvn clean install then publishes to Sonar.
312 This job purposely only runs on the master branch as there are Additional
313 configuration needed to support multiple branches and there's not much
314 interest in that kind of support.
318 - {project-name}-sonar
322 :Comment Trigger: run-sonar
324 :Required parameters:
326 :build-node: The node to run build on.
327 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
328 be configured in defaults.yaml)
329 :mvn-settings: The name of settings file containing credentials for the project.
331 :Optional parameters:
333 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
334 :build-timeout: Timeout in minutes before aborting build. (default: 60)
335 :cron: Cron schedule when to trigger the job. This parameter also
336 supports multiline input via YAML pipe | character in cases where
337 one may want to provide more than 1 cron timer. (default: 'H H * * 6'
339 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
340 :java-version: Version of Java to use for the build. (default: openjdk8)
341 :mvn-global-settings: The name of the Maven global settings to use for
342 Maven configuration. (default: global-settings)
343 :mvn-opts: Sets MAVEN_OPTS. (default: '')
344 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
345 :mvn-version: Version of maven to use. (default: mvn35)
346 :stream: Keyword that can be used to represent a release code-name.
347 Often the same as the branch. (default: master)
348 :submodule-recursive: Whether to checkout submodules recursively.
351 :gerrit_sonar_triggers: Override Gerrit Triggers.
356 Verify job which runs mvn clean install to test a project build..
360 - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
361 - gerrit-maven-verify
362 - github-maven-verify
364 :Comment Trigger: recheck|reverify
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 :branch: Git branch to fetch for the build. (default: master)
376 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
377 :build-timeout: Timeout in minutes before aborting build. (default: 60)
378 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
379 :java-version: Version of Java to use for the build. (default: openjdk8)
380 :mvn-global-settings: The name of the Maven global settings to use for
381 Maven configuration. (default: global-settings)
382 :mvn-opts: Sets MAVEN_OPTS. (default: '')
383 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
384 :mvn-version: Version of maven to use. (default: mvn35)
385 :stream: Keyword that can be used to represent a release code-name.
386 Often the same as the branch. (default: master)
387 :submodule-recursive: Whether to checkout submodules recursively.
390 :gerrit_verify_triggers: Override Gerrit Triggers.
391 :gerrit_trigger_file_paths: Override file paths which can be used to
392 filter which file modifications will trigger a build.
394 Maven Verify /w Dependencies
395 ----------------------------
397 Verify job which runs mvn clean install to test a project build /w deps
399 This job can be used to verify a patch in conjunction to all of the
400 upstream patches it depends on. The user of this job can provide a list
405 - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
406 - gerrit-maven-verify-dependencies
408 :Comment Trigger: recheck: SPACE_SEPERATED_LIST_OF_PATCHES
410 :Required parameters:
412 :build-node: The node to run build on.
413 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
414 be configured in defaults.yaml)
415 :mvn-settings: The name of settings file containing credentials for the project.
417 :Optional parameters:
419 :branch: Git branch to fetch for the build. (default: master)
420 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
421 :build-timeout: Timeout in minutes before aborting build. (default: 60)
422 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
423 :java-version: Version of Java to use for the build. (default: openjdk8)
424 :mvn-global-settings: The name of the Maven global settings to use for
425 Maven configuration. (default: global-settings)
426 :mvn-opts: Sets MAVEN_OPTS. (default: '')
427 :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
428 :mvn-version: Version of maven to use. (default: mvn35)
429 :stream: Keyword that can be used to represent a release code-name.
430 Often the same as the branch. (default: master)
431 :submodule-recursive: Whether to checkout submodules recursively.
434 :gerrit_verify_triggers: Override Gerrit Triggers.
435 :gerrit_trigger_file_paths: Override file paths which can be used to
436 filter which file modifications will trigger a build.