Merge "Add Links to Plugins mentioned in README"
[releng/global-jjb.git] / docs / jjb / lf-maven-jobs.rst
1 ##########
2 Maven Jobs
3 ##########
4
5 Job Groups
6 ==========
7
8 {project-name}-maven-jobs
9 -------------------------
10
11 Jobs for Maven projects using Gerrit.
12
13 :Includes:
14
15     - gerrit-maven-clm
16     - gerrit-maven-release
17     - gerrit-maven-verify
18     - gerrit-maven-verify-dependencies
19
20 {project-name}-github-maven-jobs
21 --------------------------------
22
23 Jobs for Maven projects using GitHub.
24
25 :Includes:
26
27     - github-maven-clm
28     - github-maven-release
29     - github-maven-verify
30
31 {project-name}-maven-javadoc-jobs
32 ---------------------------------
33
34 Jobs for Maven projects to generate javadoc using Gerrit.
35
36 :Includes:
37
38     - gerrit-maven-javadoc-publish
39     - gerrit-maven-javadoc-verify
40
41 {project-name}-github-maven-javadoc-jobs
42 ----------------------------------------
43
44 Jobs for Maven projects to generate javadoc using GitHub.
45
46 :Includes:
47
48     - github-maven-javadoc-publish
49     - github-maven-javadoc-verify
50
51
52 Macros
53 ======
54
55 lf-maven-common
56 ---------------
57
58 Common Jenkins configuration for Maven jobs.
59
60 lf-maven-deploy
61 ---------------
62
63 Calls the maven deploy script to push artifacts to Nexus.
64
65 Job Templates
66 =============
67
68 Maven CLM
69 ---------
70
71 Produces a CLM scan of the code into Nexus IQ Server.
72
73 :Template Names:
74
75     - {project-name}-maven-clm-{stream}
76     - gerrit-maven-clm
77     - github-maven-clm
78
79 :Required parameters:
80
81     :build-node:    The node to run build on.
82     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
83         be configured in defaults.yaml)
84     :mvn-settings: The name of settings file containing credentials for the project.
85
86 :Optional parameters:
87
88     :branch: The branch to build against. (default: master)
89     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
90     :build-timeout: Timeout in seconds before aborting build. (default: 60)
91     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
92     :java-version: Version of Java to use for the build. (default: openjdk8)
93     :mvn-global-settings: The name of the Maven global settings to use for
94         Maven configuration. (default: global-settings)
95     :mvn-opts: Sets MAVEN_OPTS. (default: '')
96     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
97     :mvn-version: Version of maven to use. (default: mvn33)
98     :stream: Keyword that can be used to represent a release code-name.
99         Often the same as the branch. (default: master)
100     :submodule-recursive: Whether to checkout submodules recursively.
101         (default: true)
102
103     :gerrit_merge_triggers: Override Gerrit Triggers.
104
105 Maven JavaDoc Publish
106 ---------------------
107
108 Produces and publishes javadocs for a Maven project.
109
110 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
111
112 :Template Names:
113
114     - {project-name}-maven-javadoc-publish-{stream}
115     - gerrit-maven-javadoc-publish
116     - github-maven-javadoc-publish
117
118 :Required parameters:
119
120     :build-node: The node to run build on.
121     :javadoc-path: The path in Nexus to deploy javadoc to.
122     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
123         be configured in defaults.yaml)
124     :mvn-settings: The name of settings file containing credentials for the project.
125     :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
126         (Note: This setting should be configured in defaults.yaml.)
127
128 :Optional parameters:
129
130     :branch: The branch to build against. (default: master)
131     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
132     :build-timeout: Timeout in seconds before aborting build. (default: 60)
133     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
134     :java-version: Version of Java to use for the build. (default: openjdk8)
135     :mvn-global-settings: The name of the Maven global settings to use for
136         Maven configuration. (default: global-settings)
137     :mvn-opts: Sets MAVEN_OPTS. (default: '')
138     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
139     :mvn-version: Version of maven to use. (default: mvn33)
140     :stream: Keyword that can be used to represent a release code-name.
141         Often the same as the branch. (default: master)
142     :submodule-recursive: Whether to checkout submodules recursively.
143         (default: true)
144
145     :gerrit_merge_triggers: Override Gerrit Triggers.
146
147 Maven JavaDoc Verify
148 --------------------
149
150 Produces javadocs for a Maven project.
151
152 Expects javadocs to be available in $WORKSPACE/target/site/apidocs
153
154 :Template Names:
155
156     - {project-name}-maven-javadoc-verify-{stream}
157     - gerrit-maven-javadoc-verify
158     - github-maven-javadoc-verify
159
160 :Required parameters:
161     :build-node:    The node to run build on.
162     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
163         be configured in defaults.yaml)
164     :mvn-settings: The name of settings file containing credentials for the project.
165
166 :Optional parameters:
167
168     :branch: The branch to build against. (default: master)
169     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
170     :build-timeout: Timeout in seconds before aborting build. (default: 60)
171     :deploy-path:    The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
172     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
173     :java-version: Version of Java to use for the build. (default: openjdk8)
174     :mvn-global-settings: The name of the Maven global settings to use for
175         Maven configuration. (default: global-settings)
176     :mvn-opts: Sets MAVEN_OPTS. (default: '')
177     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
178     :mvn-version: Version of maven to use. (default: mvn33)
179     :stream: Keyword that can be used to represent a release code-name.
180         Often the same as the branch. (default: master)
181     :submodule-recursive: Whether to checkout submodules recursively.
182         (default: true)
183
184     :gerrit_verify_triggers: Override Gerrit Triggers.
185
186 Maven Merge
187 -----------
188
189 Merge job which runs `mvn clean deploy` to build a project.
190
191 This job pushes files to Nexus using cURL instead of allowing the Maven deploy
192 goal to push the upload. This is to get around the issue that Maven deploy does
193 not properly support uploading files at the end of the build and instead pushes
194 as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
195 with extensions.
196
197 This job uses the following strategy to deploy jobs to Nexus:
198
199 1. `wget -r` to fetch maven-metadata.xml from Nexus
200 2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
201 3. Removes untouched maven-metadata.xml files before upload
202 4. Use lftools (cURL) upload script to push artifacts to Nexus
203
204 :Template Names:
205
206     - {project-name}-maven-merge-{stream}
207     - gerrit-maven-merge
208     - github-maven-merge
209
210 :Required parameters:
211
212     :build-node: The node to run build on.
213     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
214         be configured in defaults.yaml)
215     :mvn-settings: The name of settings file containing credentials for the project.
216     :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
217         (Note: This setting should be configured in defaults.yaml.)
218     :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
219
220 :Optional parameters:
221
222     :branch: Git branch to fetch for the build. (default: master)
223     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
224     :build-timeout: Timeout in seconds before aborting build. (default: 60)
225     :cron: Cron schedule when to trigger the job. This parameter also
226         supports multiline input via YAML pipe | character in cases where
227         one may want to provide more than 1 cron timer. (default: 'H H * * 0'
228         to run weekly)
229     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
230     :java-version: Version of Java to use for the build. (default: openjdk8)
231     :mvn-global-settings: The name of the Maven global settings to use for
232         Maven configuration. (default: global-settings)
233     :mvn-opts: Sets MAVEN_OPTS. (default: '')
234     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
235     :mvn-version: Version of maven to use. (default: mvn33)
236     :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
237     :stream: Keyword that can be used to represent a release code-name.
238         Often the same as the branch. (default: master)
239     :submodule-recursive: Whether to checkout submodules recursively.
240         (default: true)
241
242     :gerrit_merge_triggers: Override Gerrit Triggers.
243     :gerrit_trigger_file_paths: Override file paths which can be used to
244         filter which file modifications will trigger a build.
245
246 Maven Release
247 -------------
248
249 Produces a release candidate by creating a staging repo in Nexus.
250
251 Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
252 directory can then be reused later to deploy to Nexus.
253
254 :Template Names:
255
256     - {project-name}-maven-release-{stream}
257     - gerrit-maven-release
258     - github-maven-release
259
260 :Required parameters:
261
262     :build-node: The node to run build on.
263     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
264         be configured in defaults.yaml)
265     :mvn-settings: The name of settings file containing credentials for the project.
266     :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from.
267         (Note: This setting should be configured in defaults.yaml.)
268     :staging-profile-id: Profile ID of the project's Nexus staging profile.
269
270 :Optional parameters:
271
272     :archive-artifacts: Artifacts to archive to the logs server (default: '').
273     :branch: The branch to build against. (default: master)
274     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
275     :build-timeout: Timeout in seconds before aborting build. (default: 60)
276     :cron: Cron schedule when to trigger the job. This parameter also
277         supports multiline input via YAML pipe | character in cases where
278         one may want to provide more than 1 cron timer. (default: '')
279     :deploy-path:    The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
280     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
281     :java-version: Version of Java to use for the build. (default: openjdk8)
282     :mvn-global-settings: The name of the Maven global settings to use for
283         Maven configuration. (default: global-settings)
284     :mvn-opts: Sets MAVEN_OPTS. (default: '')
285     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
286     :mvn-version: Version of maven to use. (default: mvn33)
287     :stream: Keyword that can be used to represent a release code-name.
288         Often the same as the branch. (default: master)
289     :submodule-recursive: Whether to checkout submodules recursively.
290         (default: true)
291
292     :gerrit_release_triggers: Override Gerrit Triggers.
293
294 Maven Sonar
295 -----------
296
297 Sonar job which runs mvn clean install then publishes to Sonar.
298
299 This job purposely only runs on the master branch as there are Additional
300 configuration needed to support multiple branches and there's not much
301 interest in that kind of support.
302
303 :Template Names:
304
305     - {project-name}-sonar
306     - gerrit-maven-sonar
307     - github-maven-sonar
308
309 :Required parameters:
310
311     :build-node: The node to run build on.
312     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
313         be configured in defaults.yaml)
314     :mvn-settings: The name of settings file containing credentials for the project.
315
316 :Optional parameters:
317
318     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
319     :build-timeout: Timeout in seconds 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: 'H H * * 6'
323         to run weekly)
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: mvn33)
331     :stream: Keyword that can be used to represent a release code-name.
332         Often the same as the branch. (default: master)
333     :submodule-recursive: Whether to checkout submodules recursively.
334         (default: true)
335
336     :gerrit_sonar_triggers: Override Gerrit Triggers.
337
338 Maven Verify
339 ------------
340
341 Verify job which runs mvn clean install to test a project build..
342
343 :Template Names:
344
345     - {project-name}-maven-verify-{stream}-{mvn-version}-{java-version}
346     - gerrit-maven-verify
347     - github-maven-verify
348
349 :Required parameters:
350
351     :build-node: The node to run build on.
352     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
353         be configured in defaults.yaml)
354     :mvn-settings: The name of settings file containing credentials for the project.
355
356 :Optional parameters:
357
358     :branch: Git branch to fetch for the build. (default: master)
359     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
360     :build-timeout: Timeout in seconds before aborting build. (default: 60)
361     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
362     :java-version: Version of Java to use for the build. (default: openjdk8)
363     :mvn-global-settings: The name of the Maven global settings to use for
364         Maven configuration. (default: global-settings)
365     :mvn-opts: Sets MAVEN_OPTS. (default: '')
366     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
367     :mvn-version: Version of maven to use. (default: mvn33)
368     :stream: Keyword that can be used to represent a release code-name.
369         Often the same as the branch. (default: master)
370     :submodule-recursive: Whether to checkout submodules recursively.
371         (default: true)
372
373     :gerrit_verify_triggers: Override Gerrit Triggers.
374     :gerrit_trigger_file_paths: Override file paths which can be used to
375         filter which file modifications will trigger a build.
376
377 Maven Verify /w Dependencies
378 ----------------------------
379
380 Verify job which runs mvn clean install to test a project build /w deps
381
382 This job can be used to verify a patch in conjunction to all of the
383 upstream patches it depends on. The user of this job can provide a list
384 via comment trigger.
385
386 :Template Names:
387
388     - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}
389     - gerrit-maven-verify-dependencies
390
391 :Comment Trigger: recheck: SPACE_SEPERATED_LIST_OF_PATCHES
392
393 :Required parameters:
394
395     :build-node: The node to run build on.
396     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
397         be configured in defaults.yaml)
398     :mvn-settings: The name of settings file containing credentials for the project.
399
400 :Optional parameters:
401
402     :branch: Git branch to fetch for the build. (default: master)
403     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
404     :build-timeout: Timeout in minutes before aborting build. (default: 60)
405     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
406     :java-version: Version of Java to use for the build. (default: openjdk8)
407     :mvn-global-settings: The name of the Maven global settings to use for
408         Maven configuration. (default: global-settings)
409     :mvn-opts: Sets MAVEN_OPTS. (default: '')
410     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
411     :mvn-version: Version of maven to use. (default: mvn33)
412     :stream: Keyword that can be used to represent a release code-name.
413         Often the same as the branch. (default: master)
414     :submodule-recursive: Whether to checkout submodules recursively.
415         (default: true)
416
417     :gerrit_verify_triggers: Override Gerrit Triggers.
418     :gerrit_trigger_file_paths: Override file paths which can be used to
419         filter which file modifications will trigger a build.