Add submodule-disable for submodule operations
[releng/global-jjb.git] / jjb / lf-maven-jobs.yaml
1 ---
2 # This file contains job templates for Maven projects.
3
4 ##########
5 # Macros #
6 ##########
7
8 - builder:
9     name: lf-maven-build
10     builders:
11       - inject:
12           properties-content: 'MAVEN_GOALS={mvn-goals}'
13       - shell: !include-raw-escape:
14           - ../shell/common-variables.sh
15           - ../shell/maven-build.sh
16
17 - builder:
18     name: lf-maven-deploy
19     builders:
20       - shell: !include-raw:
21           - ../shell/common-variables.sh
22           - ../shell/maven-deploy.sh
23
24 - builder:
25     name: lf-maven-versions-plugin
26     builders:
27       - conditional-step:
28           condition-kind: boolean-expression
29           condition-expression: '{maven-versions-plugin}'
30           steps:
31             - inject:
32                 properties-file: version.properties
33             - maven-target:
34                 maven-version: '{mvn-version}'
35                 pom: '{mvn-pom}'
36                 goals: 'versions:set versions:update-child-modules versions:commit -B'
37                 properties:
38                   - 'newVersion=${{release_version}}'
39                 settings: '{mvn-settings}'
40                 settings-type: cfp
41                 global-settings: 'global-settings'
42                 global-settings-type: cfp
43
44 - builder:
45     name: lf-maven-stage
46     builders:
47       - lf-provide-maven-settings:
48           global-settings-file: '{mvn-global-settings}'
49           settings-file: '{mvn-settings}'
50       - lf-infra-create-netrc:
51           server-id: '{mvn-staging-id}'
52       # include-raw-escape fails due to JJB bug
53       - shell: !include-raw-escape:
54           - ../shell/common-variables.sh
55           - ../shell/maven-stage.sh
56       - lf-provide-maven-settings-cleanup
57
58 - builder:
59     name: lf-update-java-alternatives
60     builders:
61       - inject:
62           # Work around inject plugin overriding our GIT_URL variable incorrectly
63           # https://issues.jenkins-ci.org/browse/JENKINS-49775
64           properties-content: |
65             SET_JDK_VERSION={java-version}
66             GIT_URL="$GIT_URL"
67       - shell: !include-raw-escape: ../shell/update-java-alternatives.sh
68       - inject:
69           properties-file: '/tmp/java.env'
70
71 ####################
72 # COMMON FUNCTIONS #
73 ####################
74
75 - lf_maven_common: &lf_maven_common
76     name: lf-maven-common
77
78     ######################
79     # Default parameters #
80     ######################
81
82     archive-artifacts: >
83       **/*.log
84       **/hs_err_*.log
85       **/target/**/feature.xml
86       **/target/failsafe-reports/failsafe-summary.xml
87       **/target/surefire-reports/*-output.txt
88
89     #####################
90     # Job Configuration #
91     #####################
92
93     project-type: freestyle
94     node: '{build-node}'
95
96     properties:
97       - lf-infra-properties:
98           build-days-to-keep: '{build-days-to-keep}'
99
100     parameters:
101       - lf-infra-parameters:
102           project: '{project}'
103           branch: '{branch}'
104           stream: '{stream}'
105       - lf-infra-maven-parameters:
106           mvn-opts: '{mvn-opts}'
107           mvn-params: '{mvn-params}'
108           mvn-version: '{mvn-version}'
109       - string:
110           name: ARCHIVE_ARTIFACTS
111           default: '{archive-artifacts}'
112           description: Artifacts to archive to the logs server.
113
114     wrappers:
115       - lf-infra-wrappers:
116           build-timeout: '{build-timeout}'
117           jenkins-ssh-credential: '{jenkins-ssh-credential}'
118
119     publishers:
120       # TODO: Make email notification work.
121       # - lf-infra-email-notify:
122       #     email-recipients: '{email-recipients}'
123       #     email-prefix: '[releng]'
124       - lf-infra-publish
125
126 #############
127 # Maven CLM #
128 #############
129
130 - lf_maven_clm: &lf_maven_clm
131     name: lf-maven-clm
132
133     ######################
134     # Default parameters #
135     ######################
136
137     branch: master
138     build-days-to-keep: 30  # 30 days for troubleshooting purposes
139     build-timeout: 60
140     disable-job: false
141     git-url: '$GIT_URL/$PROJECT'
142     github-url: 'https://github.com'
143     java-version: openjdk8
144     mvn-global-settings: global-settings
145     mvn-opts: ''
146     mvn-params: ''
147     mvn-version: mvn35
148     nexus-iq-namespace: ''  # Recommend a trailing dash when set. Example: odl-
149     nexus-iq-stage: 'build'
150     stream: master
151     submodule-recursive: true
152     submodule-timeout: 10
153     submodule-disable: false
154
155     nexus_iq_scan_patterns:
156       - '**/*.ear'
157       - '**/*.jar'
158       - '**/*.tar.gz'
159       - '**/*.war'
160       - '**/*.zip'
161
162     gerrit_clm_triggers:
163       - comment-added-contains-event:
164           comment-contains-value: run-clm$
165
166     parameters:
167       - lf-infra-parameters:
168           project: '{project}'
169           branch: '{branch}'
170           stream: '{stream}'
171       - lf-infra-maven-parameters:
172           mvn-opts: '{mvn-opts}'
173           mvn-params: '{mvn-params}'
174           mvn-version: '{mvn-version}'
175       - string:
176           name: ARCHIVE_ARTIFACTS
177           default: '{archive-artifacts}'
178           description: Artifacts to archive to the logs server.
179       - lf-clm-parameters:
180           nexus-iq-stage: '{nexus-iq-stage}'
181
182     #####################
183     # Job Configuration #
184     #####################
185
186     disabled: '{disable-job}'
187
188     builders:
189       - lf-infra-pre-build
190       - lf-maven-install:
191           mvn-version: '{mvn-version}'
192       - lf-update-java-alternatives:
193           java-version: '{java-version}'
194       - lf-provide-maven-settings:
195           global-settings-file: '{mvn-global-settings}'
196           settings-file: '{mvn-settings}'
197       - shell: !include-raw-escape:
198           - ../shell/common-variables.sh
199           - ../shell/sonatype-clm.sh
200       - lf-provide-maven-settings-cleanup
201       - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
202       - nexus-iq-policy-evaluator:
203           stage: '{nexus-iq-stage}'
204           application-type: 'manual'
205           application-id: '{nexus-iq-namespace}{project-name}'
206           scan-patterns: '{obj:nexus_iq_scan_patterns}'
207           fail-build-network-error: true
208
209 - job-template:
210     name: '{project-name}-maven-clm-{stream}'
211     id: gerrit-maven-clm
212     <<: *lf_maven_common
213     # yamllint disable-line rule:key-duplicates
214     <<: *lf_maven_clm
215
216     scm:
217       - lf-infra-gerrit-scm:
218           jenkins-ssh-credential: '{jenkins-ssh-credential}'
219           git-url: '{git-url}'
220           refspec: '$GERRIT_REFSPEC'
221           branch: '$GERRIT_BRANCH'
222           submodule-recursive: '{submodule-recursive}'
223           submodule-timeout: '{submodule-timeout}'
224           submodule-disable: '{submodule-disable}'
225           choosing-strategy: default
226
227     triggers:
228       # Build weekly on Saturdays
229       - timed: 'H H * * 6'
230       - gerrit:
231           server-name: '{gerrit-server-name}'
232           trigger-on: '{obj:gerrit_clm_triggers}'
233           projects:
234             - project-compare-type: ANT
235               project-pattern: '{project}'
236               branches:
237                 - branch-compare-type: ANT
238                   branch-pattern: '**/{branch}'
239           skip-vote:
240             successful: true
241             failed: true
242             unstable: true
243             notbuilt: true
244
245 - job-template:
246     name: '{project-name}-maven-clm-{stream}'
247     id: github-maven-clm
248     <<: *lf_maven_common
249     # yamllint disable-line rule:key-duplicates
250     <<: *lf_maven_clm
251
252     properties:
253       - lf-infra-properties:
254           build-days-to-keep: '{build-days-to-keep}'
255       - github:
256           url: '{github-url}/{github-org}/{project}'
257
258     scm:
259       - lf-infra-github-scm:
260           url: '{git-clone-url}{github-org}/{project}'
261           refspec: ''
262           branch: 'refs/heads/{branch}'
263           submodule-recursive: '{submodule-recursive}'
264           submodule-timeout: '{submodule-timeout}'
265           submodule-disable: '{submodule-disable}'
266           choosing-strategy: default
267           jenkins-ssh-credential: '{jenkins-ssh-credential}'
268
269     triggers:
270       # Build weekly on Saturdays
271       - timed: 'H H * * 6'
272       - github-pull-request:
273           trigger-phrase: '^run-clm$'
274           only-trigger-phrase: true
275           status-context: 'CLM'
276           permit-all: true
277           github-hooks: true
278           org-list:
279             - '{github-org}'
280           white-list: '{obj:github_pr_whitelist}'
281           admin-list: '{obj:github_pr_admin_list}'
282           white-list-target-branches:
283             - '{branch}'
284
285 #########################
286 # Maven Javadoc Publish #
287 #########################
288
289 - lf_maven_javadoc_publish: &lf_maven_javadoc_publish
290     name: lf-maven-javadoc-publish
291
292     ######################
293     # Default parameters #
294     ######################
295
296     branch: master
297     build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
298     build-timeout: 60
299     disable-job: false
300     git-url: '$GIT_URL/$PROJECT'
301     github-url: 'https://github.com'
302     java-version: openjdk8
303     mvn-global-settings: global-settings
304     mvn-opts: ''
305     mvn-params: ''
306     mvn-version: mvn35
307     stream: master
308     submodule-recursive: true
309     submodule-timeout: 10
310     submodule-disable: false
311
312     gerrit_merge_triggers:
313       - change-merged-event
314       - comment-added-contains-event:
315           comment-contains-value: remerge$
316
317     #####################
318     # Job Configuration #
319     #####################
320
321     disabled: '{disable-job}'
322
323     builders:
324       - lf-infra-pre-build
325       - lf-maven-install:
326           mvn-version: '{mvn-version}'
327       - lf-update-java-alternatives:
328           java-version: '{java-version}'
329       - lf-provide-maven-settings:
330           global-settings-file: '{mvn-global-settings}'
331           settings-file: '{mvn-settings}'
332       - lf-infra-create-netrc:
333           server-id: '{mvn-site-id}'
334       - inject:
335           properties-content: 'DEPLOY_PATH={javadoc-path}'
336       - shell: !include-raw-escape:
337           - ../shell/common-variables.sh
338           - ../shell/maven-javadoc-generate.sh
339           - ../shell/maven-javadoc-publish.sh
340       - lf-provide-maven-settings-cleanup
341
342 - job-template:
343     name: '{project-name}-maven-javadoc-publish-{stream}-{java-version}'
344     id: gerrit-maven-javadoc-publish
345     <<: *lf_maven_common
346     # yamllint disable-line rule:key-duplicates
347     <<: *lf_maven_javadoc_publish
348
349     git-url: '$GIT_URL/$GERRIT_PROJECT'
350
351     scm:
352       - lf-infra-gerrit-scm:
353           git-url: '{git-url}'
354           refspec: ''
355           branch: '{branch}'
356           submodule-recursive: '{submodule-recursive}'
357           submodule-timeout: '{submodule-timeout}'
358           submodule-disable: '{submodule-disable}'
359           choosing-strategy: default
360           jenkins-ssh-credential: '{jenkins-ssh-credential}'
361
362     triggers:
363       - gerrit:
364           server-name: '{gerrit-server-name}'
365           trigger-on: '{obj:gerrit_merge_triggers}'
366           projects:
367             - project-compare-type: ANT
368               project-pattern: '{project}'
369               branches:
370                 - branch-compare-type: ANT
371                   branch-pattern: '**/{branch}'
372
373 - job-template:
374     name: '{project-name}-maven-javadoc-publish-{stream}-{java-version}'
375     id: github-maven-javadoc-publish
376     <<: *lf_maven_common
377     # yamllint disable-line rule:key-duplicates
378     <<: *lf_maven_javadoc_publish
379
380     properties:
381       - lf-infra-properties:
382           build-days-to-keep: '{build-days-to-keep}'
383       - github:
384           url: '{github-url}/{github-org}/{project}'
385
386     scm:
387       - lf-infra-github-scm:
388           url: '{git-clone-url}{github-org}/{project}'
389           refspec: ''
390           branch: '{branch}'
391           submodule-recursive: '{submodule-recursive}'
392           submodule-timeout: '{submodule-timeout}'
393           submodule-disable: '{submodule-disable}'
394           choosing-strategy: default
395           jenkins-ssh-credential: '{jenkins-ssh-credential}'
396
397     triggers:
398       - github
399       - pollscm:
400           cron: ''
401       - github-pull-request:
402           trigger-phrase: '^remerge$'
403           only-trigger-phrase: true
404           status-context: 'Maven Javadoc Publish'
405           permit-all: true
406           github-hooks: true
407           org-list:
408             - '{github-org}'
409           white-list: '{obj:github_pr_whitelist}'
410           admin-list: '{obj:github_pr_admin_list}'
411           white-list-target-branches:
412             - '{branch}'
413
414 ########################
415 # Maven Javadoc Verify #
416 ########################
417
418 - lf_maven_javadoc_verify: &lf_maven_javadoc_verify
419     name: lf-maven-javadoc-verify
420
421     ######################
422     # Default parameters #
423     ######################
424
425     branch: master
426     build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
427     build-timeout: 60
428     disable-job: false
429     git-url: '$GIT_URL/$PROJECT'
430     github-url: 'https://github.com'
431     java-version: openjdk8
432     mvn-global-settings: global-settings
433     mvn-opts: ''
434     mvn-params: ''
435     mvn-version: mvn35
436     stream: master
437     submodule-recursive: true
438     submodule-timeout: 10
439     submodule-disable: false
440
441     gerrit_verify_triggers:
442       - patchset-created-event:
443           exclude-drafts: true
444           exclude-trivial-rebase: false
445           exclude-no-code-change: false
446       - draft-published-event
447       - comment-added-contains-event:
448           comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
449
450     #####################
451     # Job Configuration #
452     #####################
453
454     concurrent: true
455     disabled: '{disable-job}'
456
457     builders:
458       - lf-infra-pre-build
459       - lf-maven-install:
460           mvn-version: '{mvn-version}'
461       - lf-update-java-alternatives:
462           java-version: '{java-version}'
463       - lf-provide-maven-settings:
464           global-settings-file: '{mvn-global-settings}'
465           settings-file: '{mvn-settings}'
466       - shell: !include-raw-escape:
467           - ../shell/common-variables.sh
468           - ../shell/maven-javadoc-generate.sh
469       - lf-provide-maven-settings-cleanup
470
471 - job-template:
472     name: '{project-name}-maven-javadoc-verify-{stream}-{java-version}'
473     id: gerrit-maven-javadoc-verify
474     <<: *lf_maven_common
475     # yamllint disable-line rule:key-duplicates
476     <<: *lf_maven_javadoc_verify
477
478     scm:
479       - lf-infra-gerrit-scm:
480           jenkins-ssh-credential: '{jenkins-ssh-credential}'
481           git-url: '{git-url}'
482           refspec: '$GERRIT_REFSPEC'
483           branch: '$GERRIT_BRANCH'
484           submodule-recursive: '{submodule-recursive}'
485           submodule-timeout: '{submodule-timeout}'
486           submodule-disable: '{submodule-disable}'
487           choosing-strategy: gerrit
488
489     triggers:
490       - gerrit:
491           server-name: '{gerrit-server-name}'
492           trigger-on: '{obj:gerrit_verify_triggers}'
493           projects:
494             - project-compare-type: ANT
495               project-pattern: '{project}'
496               branches:
497                 - branch-compare-type: ANT
498                   branch-pattern: '**/{branch}'
499
500 - job-template:
501     name: '{project-name}-maven-javadoc-verify-{stream}-{java-version}'
502     id: github-maven-javadoc-verify
503     <<: *lf_maven_common
504     # yamllint disable-line rule:key-duplicates
505     <<: *lf_maven_javadoc_verify
506
507     properties:
508       - lf-infra-properties:
509           build-days-to-keep: '{build-days-to-keep}'
510       - github:
511           url: '{github-url}/{github-org}/{project}'
512
513     scm:
514       - lf-infra-github-scm:
515           url: '{git-clone-url}{github-org}/{project}'
516           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
517           branch: '$sha1'
518           submodule-recursive: '{submodule-recursive}'
519           submodule-timeout: '{submodule-timeout}'
520           submodule-disable: '{submodule-disable}'
521           choosing-strategy: default
522           jenkins-ssh-credential: '{jenkins-ssh-credential}'
523
524     triggers:
525       - github-pull-request:
526           trigger-phrase: ^(recheck|reverify)$
527           only-trigger-phrase: false
528           status-context: 'Maven Javadoc Verify'
529           permit-all: true
530           github-hooks: true
531           white-list-target-branches:
532             - '{branch}'
533
534 ###############
535 # Maven Merge #
536 ###############
537
538 - lf_maven_merge: &lf_maven_merge
539     name: lf-maven-merge
540
541     ######################
542     # Default parameters #
543     ######################
544
545     branch: master
546     build-days-to-keep: 30  # 30 days in case we need to troubleshoot
547     build-timeout: 60
548     cron: '@daily'
549     disable-job: false
550     git-url: '$GIT_URL/$PROJECT'
551     github-url: 'https://github.com'
552     java-version: openjdk8
553     mvn-global-settings: global-settings
554     mvn-goals: clean deploy
555     mvn-opts: ''
556     mvn-params: '-Dmerge'
557     mvn-version: mvn35
558     nexus-cut-dirs: 6  # Number of dirs in the Nexus path to remove for wget -r.
559     stream: master
560     submodule-recursive: true
561     submodule-timeout: 10
562     submodule-disable: false
563
564     gerrit_merge_triggers:
565       - change-merged-event
566       - comment-added-contains-event:
567           comment-contains-value: remerge$
568
569     gerrit_trigger_file_paths:
570       - compare-type: REG_EXP
571         pattern: '.*'
572
573     # github_included_regions MUST match gerrit_trigger_file_paths
574     github_included_regions:
575       - '.*'
576
577     post_build_trigger: ''
578
579     #####################
580     # Job Configuration #
581     #####################
582
583     disabled: '{disable-job}'
584
585     builders:
586       - lf-infra-pre-build
587       - lf-jacoco-nojava-workaround
588       - lf-maven-install:
589           mvn-version: '{mvn-version}'
590       - lf-update-java-alternatives:
591           java-version: '{java-version}'
592       - lf-provide-maven-settings:
593           global-settings-file: '{mvn-global-settings}'
594           settings-file: '{mvn-settings}'
595       - lf-infra-create-netrc:
596           server-id: '{mvn-snapshot-id}'
597       - inject:
598           properties-content: |
599               NEXUS_CUT_DIRS={nexus-cut-dirs}
600               NEXUS_REPO={nexus-snapshot-repo}
601       - shell: !include-raw-escape: ../shell/maven-fetch-metadata.sh
602       - lf-maven-build:
603           mvn-goals: '{mvn-goals}'
604       - lf-maven-deploy
605       - lf-provide-maven-settings-cleanup
606
607     publishers:
608       - findbugs
609       - lf-jacoco-report
610       - lf-infra-publish
611       - trigger-parameterized-builds: '{obj:post_build_trigger}'
612
613 - job-template:
614     name: '{project-name}-maven-merge-{stream}'
615     id: gerrit-maven-merge
616     <<: *lf_maven_common
617     # yamllint disable-line rule:key-duplicates
618     <<: *lf_maven_merge
619
620     scm:
621       - lf-infra-gerrit-scm:
622           jenkins-ssh-credential: '{jenkins-ssh-credential}'
623           git-url: '{git-url}'
624           refspec: '$GERRIT_REFSPEC'
625           branch: '$GERRIT_BRANCH'
626           submodule-recursive: '{submodule-recursive}'
627           submodule-timeout: '{submodule-timeout}'
628           submodule-disable: '{submodule-disable}'
629           choosing-strategy: default
630
631     triggers:
632       - timed: '{obj:cron}'
633       - gerrit:
634           server-name: '{gerrit-server-name}'
635           trigger-on: '{obj:gerrit_merge_triggers}'
636           projects:
637             - project-compare-type: ANT
638               project-pattern: '{project}'
639               branches:
640                 - branch-compare-type: ANT
641                   branch-pattern: '**/{branch}'
642               file-paths: '{obj:gerrit_trigger_file_paths}'
643
644 - job-template:
645     name: '{project-name}-maven-merge-{stream}'
646     id: github-maven-merge
647     <<: *lf_maven_common
648     # yamllint disable-line rule:key-duplicates
649     <<: *lf_maven_merge
650
651     properties:
652       - lf-infra-properties:
653           build-days-to-keep: '{build-days-to-keep}'
654       - github:
655           url: '{github-url}/{github-org}/{project}'
656
657     scm:
658       - lf-infra-github-scm:
659           url: '{git-clone-url}{github-org}/{project}'
660           refspec: ''
661           branch: 'refs/heads/{branch}'
662           submodule-recursive: '{submodule-recursive}'
663           submodule-timeout: '{submodule-timeout}'
664           submodule-disable: '{submodule-disable}'
665           choosing-strategy: default
666           jenkins-ssh-credential: '{jenkins-ssh-credential}'
667
668     triggers:
669       - timed: '{obj:cron}'
670       - github
671       - pollscm:
672           cron: ''
673       - github-pull-request:
674           trigger-phrase: '^remerge$'
675           only-trigger-phrase: true
676           status-context: 'Maven Merge'
677           permit-all: true
678           github-hooks: true
679           org-list:
680             - '{github-org}'
681           white-list: '{obj:github_pr_whitelist}'
682           admin-list: '{obj:github_pr_admin_list}'
683           white-list-target-branches:
684             - '{branch}'
685           included-regions: '{obj:github_included_regions}'
686
687 ##########################
688 # Maven Merge for Docker #
689 ##########################
690
691 - lf_maven_docker_merge: &lf_maven_docker_merge
692     name: lf-maven-docker-merge
693
694     builders:
695       - lf-infra-pre-build
696       - lf-jacoco-nojava-workaround
697       - lf-maven-install:
698           mvn-version: '{mvn-version}'
699       - lf-infra-docker-login:
700           global-settings-file: '{mvn-global-settings}'
701           settings-file: '{mvn-settings}'
702       - lf-update-java-alternatives:
703           java-version: '{java-version}'
704       # must provide maven settings AFTER docker due to its cleanup
705       - lf-provide-maven-settings:
706           global-settings-file: '{mvn-global-settings}'
707           settings-file: '{mvn-settings}'
708       - lf-infra-create-netrc:
709           server-id: '{mvn-snapshot-id}'
710       - inject:
711           properties-content: |
712               NEXUS_CUT_DIRS={nexus-cut-dirs}
713               NEXUS_REPO={nexus-snapshot-repo}
714               CONTAINER_PULL_REGISTRY={container-public-registry}
715               CONTAINER_PUSH_REGISTRY={container-snapshot-registry}
716       - shell: !include-raw-escape: ../shell/maven-fetch-metadata.sh
717       - lf-maven-build:
718           mvn-goals: '{mvn-goals}'
719       # NO lf-maven-deploy
720       - lf-provide-maven-settings-cleanup
721
722 - job-template:
723     name: '{project-name}-maven-docker-merge-{stream}'
724     id: gerrit-maven-docker-merge
725     <<: *lf_maven_common
726     # yamllint disable-line rule:key-duplicates
727     <<: *lf_maven_merge
728     # yamllint disable-line rule:key-duplicates
729     <<: *lf_maven_docker_merge
730
731     scm:
732       - lf-infra-gerrit-scm:
733           jenkins-ssh-credential: '{jenkins-ssh-credential}'
734           git-url: '{git-url}'
735           refspec: '$GERRIT_REFSPEC'
736           branch: '$GERRIT_BRANCH'
737           submodule-recursive: '{submodule-recursive}'
738           submodule-timeout: '{submodule-timeout}'
739           submodule-disable: '{submodule-disable}'
740           choosing-strategy: default
741
742     triggers:
743       - gerrit:
744           server-name: '{gerrit-server-name}'
745           trigger-on: '{obj:gerrit_merge_triggers}'
746           projects:
747             - project-compare-type: ANT
748               project-pattern: '{project}'
749               branches:
750                 - branch-compare-type: ANT
751                   branch-pattern: '**/{branch}'
752               file-paths: '{obj:gerrit_trigger_file_paths}'
753
754 - job-template:
755     name: '{project-name}-maven-docker-merge-{stream}'
756     id: github-maven-docker-merge
757     <<: *lf_maven_common
758     # yamllint disable-line rule:key-duplicates
759     <<: *lf_maven_merge
760     # yamllint disable-line rule:key-duplicates
761     <<: *lf_maven_docker_merge
762
763     properties:
764       - lf-infra-properties:
765           build-days-to-keep: '{build-days-to-keep}'
766       - github:
767           url: '{github-url}/{github-org}/{project}'
768
769     scm:
770       - lf-infra-github-scm:
771           url: '{git-clone-url}{github-org}/{project}'
772           refspec: ''
773           branch: 'refs/heads/{branch}'
774           submodule-recursive: '{submodule-recursive}'
775           submodule-timeout: '{submodule-timeout}'
776           submodule-disable: '{submodule-disable}'
777           choosing-strategy: default
778           jenkins-ssh-credential: '{jenkins-ssh-credential}'
779
780     triggers:
781       - github
782       - pollscm:
783           cron: ''
784       - github-pull-request:
785           trigger-phrase: '^remerge$'
786           only-trigger-phrase: true
787           status-context: 'Maven Docker Merge'
788           permit-all: true
789           github-hooks: true
790           org-list:
791             - '{github-org}'
792           white-list: '{obj:github_pr_whitelist}'
793           admin-list: '{obj:github_pr_admin_list}'
794           white-list-target-branches:
795             - '{branch}'
796           included-regions: '{obj:github_included_regions}'
797
798 ###############
799 # Maven Stage #
800 ###############
801
802 - lf_maven_stage: &lf_maven_stage
803     name: lf-maven-stage
804
805     ######################
806     # Default parameters #
807     ######################
808
809     branch: master
810     build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
811     build-timeout: 60
812     cron: '@daily'
813     disable-job: false
814     git-url: '$GIT_URL/$PROJECT'
815     github-url: 'https://github.com'
816     java-version: openjdk8
817     maven-versions-plugin: false
818     mvn-central: false
819     mvn-global-settings: global-settings
820     mvn-goals: clean deploy
821     mvn-opts: ''
822     mvn-params: ''
823     mvn-version: mvn35
824     ossrh-profile-id: ''
825     mvn-pom: ''
826     sign-artifacts: false
827     sign-mode: serial
828     stream: master
829     submodule-recursive: true
830     submodule-timeout: 10
831     submodule-disable: false
832
833     gerrit_release_triggers:
834       - comment-added-contains-event:
835           comment-contains-value: stage-release$
836
837     #####################
838     # Job Configuration #
839     #####################
840
841     disabled: '{disable-job}'
842
843     parameters:
844       - lf-infra-parameters:
845           project: '{project}'
846           branch: '{branch}'
847           stream: '{stream}'
848       - lf-infra-maven-parameters:
849           mvn-opts: '{mvn-opts}'
850           mvn-params: '{mvn-params}'
851           mvn-version: '{mvn-version}'
852           staging-profile-id: '{staging-profile-id}'
853       - bool:
854           name: MAVEN_VERSIONS_PLUGIN
855           default: '{maven-versions-plugin}'
856           description: Use maven-versions-plugin to update pom versions.
857       - string:
858           name: ARCHIVE_ARTIFACTS
859           default: '{archive-artifacts}'
860           description: Artifacts to archive to the logs server.
861       - string:
862           name: STAGING_PROFILE_ID
863           default: '{staging-profile-id}'
864           description: Nexus staging profile ID.
865
866     builders:
867       - lf-infra-pre-build
868       - lf-jacoco-nojava-workaround
869       - lf-maven-install:
870           mvn-version: '{mvn-version}'
871       - lf-update-java-alternatives:
872           java-version: '{java-version}'
873       - lf-provide-maven-settings:
874           global-settings-file: '{mvn-global-settings}'
875           settings-file: '{mvn-settings}'
876       - lf-maven-versions-plugin:
877           maven-versions-plugin: '{maven-versions-plugin}'
878           mvn-version: '{mvn-version}'
879           mvn-pom: '{mvn-pom}'
880           mvn-settings: '{mvn-settings}'
881       - shell: !include-raw-escape: ../shell/maven-patch-release.sh
882       - lf-maven-build:
883           mvn-goals: '{mvn-goals}'
884       - lf-sigul-sign-dir:
885           sign-artifacts: '{sign-artifacts}'
886           sign-dir: '$WORKSPACE/m2repo'
887           sign-mode: '{sign-mode}'
888       - lf-maven-stage:
889           mvn-global-settings: '{mvn-global-settings}'
890           mvn-settings: '{mvn-settings}'
891           mvn-staging-id: '{mvn-staging-id}'
892       - lf-maven-central:
893           mvn-central: '{mvn-central}'
894           mvn-global-settings: '{mvn-global-settings}'
895           mvn-settings: '{mvn-settings}'
896           ossrh-profile-id: '{ossrh-profile-id}'
897       - lf-provide-maven-settings-cleanup
898
899 - job-template:
900     name: '{project-name}-maven-stage-{stream}'
901     id: gerrit-maven-stage
902     <<: *lf_maven_common
903     # yamllint disable-line rule:key-duplicates
904     <<: *lf_maven_stage
905
906     scm:
907       - lf-infra-gerrit-scm:
908           jenkins-ssh-credential: '{jenkins-ssh-credential}'
909           git-url: '{git-url}'
910           refspec: '$GERRIT_REFSPEC'
911           branch: '$GERRIT_BRANCH'
912           submodule-recursive: '{submodule-recursive}'
913           submodule-timeout: '{submodule-timeout}'
914           submodule-disable: '{submodule-disable}'
915           choosing-strategy: default
916
917     triggers:
918       - timed: '{obj:cron}'
919       - gerrit:
920           server-name: '{gerrit-server-name}'
921           trigger-on: '{obj:gerrit_release_triggers}'
922           projects:
923             - project-compare-type: ANT
924               project-pattern: '{project}'
925               branches:
926                 - branch-compare-type: ANT
927                   branch-pattern: '**/{branch}'
928
929 - job-template:
930     name: '{project-name}-maven-stage-{stream}'
931     id: github-maven-stage
932     <<: *lf_maven_common
933     # yamllint disable-line rule:key-duplicates
934     <<: *lf_maven_stage
935
936     properties:
937       - lf-infra-properties:
938           build-days-to-keep: '{build-days-to-keep}'
939       - github:
940           url: '{github-url}/{github-org}/{project}'
941
942     scm:
943       - lf-infra-github-scm:
944           url: '{git-clone-url}{github-org}/{project}'
945           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
946           branch: '{branch}'
947           submodule-recursive: '{submodule-recursive}'
948           submodule-timeout: '{submodule-timeout}'
949           submodule-disable: '{submodule-disable}'
950           choosing-strategy: default
951           jenkins-ssh-credential: '{jenkins-ssh-credential}'
952
953     triggers:
954       - timed: '{obj:cron}'
955       - github-pull-request:
956           trigger-phrase: '^build release$'
957           only-trigger-phrase: true
958           status-context: 'Maven Release'
959           permit-all: true
960           github-hooks: true
961           white-list-target-branches:
962             - '{branch}'
963
964 ##########################
965 # Maven Stage for Docker #
966 ##########################
967
968 - lf_maven_docker_stage: &lf_maven_docker_stage
969     name: lf-maven-docker-stage
970
971     builders:
972       - lf-infra-pre-build
973       - lf-jacoco-nojava-workaround
974       - lf-maven-install:
975           mvn-version: '{mvn-version}'
976       - lf-update-java-alternatives:
977           java-version: '{java-version}'
978       - lf-infra-docker-login:
979           global-settings-file: '{mvn-global-settings}'
980           settings-file: '{mvn-settings}'
981       # must provide maven settings AFTER docker-login due to its cleanup
982       - lf-provide-maven-settings:
983           global-settings-file: '{mvn-global-settings}'
984           settings-file: '{mvn-settings}'
985       - shell: !include-raw-escape: ../shell/maven-patch-release.sh
986       - lf-maven-versions-plugin:
987           maven-versions-plugin: '{maven-versions-plugin}'
988           mvn-version: '{mvn-version}'
989           mvn-pom: '{mvn-pom}'
990           mvn-settings: '{mvn-settings}'
991       - inject:
992           properties-content: |
993               CONTAINER_PULL_REGISTRY={container-public-registry}
994               CONTAINER_PUSH_REGISTRY={container-staging-registry}
995       - lf-maven-build:
996           mvn-goals: '{mvn-goals}'
997       - lf-sigul-sign-dir:
998           sign-artifacts: '{sign-artifacts}'
999           sign-dir: '$WORKSPACE/m2repo'
1000           sign-mode: '{sign-mode}'
1001       # NO lf-maven-stage
1002       # NO lf-maven-central
1003       - lf-provide-maven-settings-cleanup
1004
1005 - job-template:
1006     name: '{project-name}-maven-docker-stage-{stream}'
1007     id: gerrit-maven-docker-stage
1008     <<: *lf_maven_common
1009     # yamllint disable-line rule:key-duplicates
1010     <<: *lf_maven_stage
1011     # yamllint disable-line rule:key-duplicates
1012     <<: *lf_maven_docker_stage
1013
1014     scm:
1015       - lf-infra-gerrit-scm:
1016           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1017           git-url: '{git-url}'
1018           refspec: '$GERRIT_REFSPEC'
1019           branch: '$GERRIT_BRANCH'
1020           submodule-recursive: '{submodule-recursive}'
1021           submodule-timeout: '{submodule-timeout}'
1022           submodule-disable: '{submodule-disable}'
1023           choosing-strategy: default
1024
1025     triggers:
1026       - timed: '{obj:cron}'
1027       - gerrit:
1028           server-name: '{gerrit-server-name}'
1029           trigger-on: '{obj:gerrit_release_triggers}'
1030           projects:
1031             - project-compare-type: ANT
1032               project-pattern: '{project}'
1033               branches:
1034                 - branch-compare-type: ANT
1035                   branch-pattern: '**/{branch}'
1036
1037 - job-template:
1038     name: '{project-name}-maven-docker-stage-{stream}'
1039     id: github-maven-docker-stage
1040     <<: *lf_maven_common
1041     # yamllint disable-line rule:key-duplicates
1042     <<: *lf_maven_stage
1043     # yamllint disable-line rule:key-duplicates
1044     <<: *lf_maven_docker_stage
1045
1046     properties:
1047       - lf-infra-properties:
1048           build-days-to-keep: '{build-days-to-keep}'
1049       - github:
1050           url: '{github-url}/{github-org}/{project}'
1051
1052     scm:
1053       - lf-infra-github-scm:
1054           url: '{git-clone-url}{github-org}/{project}'
1055           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1056           branch: '{branch}'
1057           submodule-recursive: '{submodule-recursive}'
1058           submodule-timeout: '{submodule-timeout}'
1059           submodule-disable: '{submodule-disable}'
1060           choosing-strategy: default
1061           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1062
1063     triggers:
1064       - timed: '{obj:cron}'
1065       - github-pull-request:
1066           trigger-phrase: '^build release$'
1067           only-trigger-phrase: true
1068           status-context: 'Maven Release'
1069           permit-all: true
1070           github-hooks: true
1071           white-list-target-branches:
1072             - '{branch}'
1073
1074 ###############
1075 # Maven Sonar #
1076 ###############
1077
1078 - lf_maven_sonar: &lf_maven_sonar
1079     name: lf-maven-sonar
1080
1081     ######################
1082     # Default parameters #
1083     ######################
1084
1085     branch: master  # Sonar should always be run on master branch
1086     build-days-to-keep: 7
1087     build-timeout: 60
1088     cron: 'H H * * 6'  # run weekly
1089     disable-job: false
1090     git-url: '$GIT_URL/$PROJECT'
1091     github-url: 'https://github.com'
1092     java-version: openjdk8
1093     mvn-global-settings: global-settings
1094     mvn-opts: ''
1095     mvn-params: ''
1096     mvn-version: mvn35
1097     sonar-mvn-goal: 'sonar:sonar'
1098     sonarcloud: false
1099     sonarcloud-project-key: ''
1100     sonarcloud-project-organization: ''
1101     sonarcloud-api-token: ''
1102     stream: master
1103     submodule-recursive: true
1104     submodule-timeout: 10
1105     submodule-disable: false
1106
1107     gerrit_sonar_triggers:
1108       - comment-added-contains-event:
1109           comment-contains-value: run-sonar$
1110
1111     #####################
1112     # Job Configuration #
1113     #####################
1114
1115     disabled: '{disable-job}'
1116
1117     parameters:
1118       - lf-infra-parameters:
1119           project: '{project}'
1120           branch: '{branch}'
1121           stream: '{stream}'
1122       - lf-infra-maven-parameters:
1123           mvn-opts: '{mvn-opts}'
1124           mvn-params: '{mvn-params}'
1125           mvn-version: '{mvn-version}'
1126       - string:
1127           name: ARCHIVE_ARTIFACTS
1128           default: '{archive-artifacts}'
1129           description: Artifacts to archive to the logs server.
1130       - string:
1131           name: SONAR_MAVEN_GOAL
1132           default: '{sonar-mvn-goal}'
1133           description: |
1134               Maven goals to pass to the Sonar call. Typically sonar:sonar
1135               however to use a specific version of the sonar-maven-plugin we
1136               can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
1137
1138     triggers:
1139       - timed: '{obj:cron}'
1140       - gerrit:
1141           server-name: '{gerrit-server-name}'
1142           trigger-on: '{obj:gerrit_sonar_triggers}'
1143           projects:
1144             - project-compare-type: 'ANT'
1145               project-pattern: '{project}'
1146               branches:
1147                 - branch-compare-type: 'ANT'
1148                   branch-pattern: '**/master'
1149           skip-vote:
1150             successful: true
1151             failed: true
1152             unstable: true
1153             notbuilt: true
1154
1155     builders:
1156       - lf-infra-pre-build
1157       # With SonarCloud
1158       - conditional-step:
1159           condition-kind: boolean-expression
1160           condition-expression: '{sonarcloud}'
1161           steps:
1162             - shell: echo 'Using SonarCloud'
1163             - lf-infra-maven-sonarcloud:
1164                 java-version: '{java-version}'
1165                 mvn-settings: '{mvn-settings}'
1166                 mvn-version: '{mvn-version}'
1167                 sonarcloud-project-key: '{sonarcloud-project-key}'
1168                 sonarcloud-project-organization: '{sonarcloud-project-organization}'
1169                 sonarcloud-api-token: '{sonarcloud-api-token}'
1170       # With SonarQube
1171       - conditional-step:
1172           condition-kind: not
1173           condition-operand:
1174             condition-kind: boolean-expression
1175             condition-expression: '{sonarcloud}'
1176           steps:
1177             - shell: echo 'Using SonarQube'
1178             - lf-infra-maven-sonar:
1179                 java-version: '{java-version}'
1180                 mvn-settings: '{mvn-settings}'
1181                 mvn-version: '{mvn-version}'
1182
1183     publishers:
1184       - lf-jacoco-report
1185       - findbugs
1186       - lf-infra-publish
1187
1188 - builder:
1189     name: lf-infra-maven-sonar
1190     # Run a Sonar build with Maven
1191     builders:
1192       - lf-maven-install:
1193           mvn-version: '{mvn-version}'
1194       - lf-update-java-alternatives:
1195           java-version: '{java-version}'
1196       - inject:
1197           # Switch this to the sonar wrapper when JJB 2.0 is available
1198           properties-content: SONAR_HOST_URL=$SONAR_URL
1199       - lf-provide-maven-settings:
1200           global-settings-file: global-settings
1201           settings-file: '{mvn-settings}'
1202       - shell: !include-raw-escape:
1203           - ../shell/common-variables.sh
1204           - ../shell/maven-sonar.sh
1205       - lf-provide-maven-settings-cleanup
1206
1207 - builder:
1208     name: lf-infra-maven-sonarcloud
1209     # Run a Sonar build with Maven
1210     builders:
1211       - lf-maven-install:
1212           mvn-version: '{mvn-version}'
1213       - lf-update-java-alternatives:
1214           java-version: '{java-version}'
1215       - inject:
1216           # Switch this to the sonar wrapper when JJB 2.0 is available
1217           properties-content: |
1218             SONAR_HOST_URL=https://sonarcloud.io
1219             PROJECT_KEY={sonarcloud-project-key}
1220             PROJECT_ORGANIZATION={sonarcloud-project-organization}
1221             API_TOKEN={sonarcloud-api-token}
1222       - lf-provide-maven-settings:
1223           global-settings-file: global-settings
1224           settings-file: '{mvn-settings}'
1225       - shell: !include-raw-escape:
1226           - ../shell/common-variables.sh
1227           - ../shell/maven-sonar.sh
1228       - lf-provide-maven-settings-cleanup
1229
1230 - job-template:
1231     name: '{project-name}-sonar'
1232     id: gerrit-maven-sonar
1233     <<: *lf_maven_common
1234     # yamllint disable-line rule:key-duplicates
1235     <<: *lf_maven_sonar
1236
1237     scm:
1238       - lf-infra-gerrit-scm:
1239           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1240           git-url: '{git-url}'
1241           refspec: $GERRIT_REFSPEC
1242           branch: $GERRIT_BRANCH
1243           submodule-recursive: '{submodule-recursive}'
1244           submodule-timeout: '{submodule-timeout}'
1245           submodule-disable: '{submodule-disable}'
1246           choosing-strategy: default
1247
1248 - job-template:
1249     name: '{project-name}-sonar'
1250     id: github-maven-sonar
1251     <<: *lf_maven_common
1252     # yamllint disable-line rule:key-duplicates
1253     <<: *lf_maven_sonar
1254
1255     properties:
1256       - lf-infra-properties:
1257           build-days-to-keep: '{build-days-to-keep}'
1258       - github:
1259           url: '{github-url}/{github-org}/{project}'
1260
1261     scm:
1262       - lf-infra-github-scm:
1263           url: '{git-clone-url}{github-org}/{project}'
1264           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1265           branch: '$sha1'
1266           submodule-recursive: '{submodule-recursive}'
1267           submodule-timeout: '{submodule-timeout}'
1268           submodule-disable: '{submodule-disable}'
1269           choosing-strategy: default
1270           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1271
1272     triggers:
1273       - timed: '{obj:cron}'
1274       - github-pull-request:
1275           trigger-phrase: '^run-sonar$'
1276           only-trigger-phrase: true
1277           status-context: 'Maven Sonar'
1278           permit-all: true
1279           github-hooks: true
1280           org-list:
1281             - '{github-org}'
1282           white-list: '{obj:github_pr_whitelist}'
1283           admin-list: '{obj:github_pr_admin_list}'
1284           white-list-target-branches:
1285             - '{branch}'
1286
1287 ################
1288 # Maven Verify #
1289 ################
1290
1291 - lf_maven_verify: &lf_maven_verify
1292     name: lf-maven-verify
1293
1294     ######################
1295     # Default parameters #
1296     ######################
1297
1298     branch: master
1299     build-days-to-keep: 7
1300     build-timeout: 60
1301     disable-job: false
1302     git-url: '$GIT_URL/$PROJECT'
1303     github-url: 'https://github.com'
1304     java-version: openjdk8
1305     mvn-global-settings: global-settings
1306     mvn-goals: clean deploy
1307     mvn-opts: ''
1308     mvn-params: '-Dstream=$STREAM -Dmaven.source.skip=true'
1309     mvn-version: mvn35
1310     stream: master
1311     submodule-recursive: true
1312     submodule-timeout: 10
1313     submodule-disable: false
1314
1315     gerrit_verify_triggers:
1316       - patchset-created-event:
1317           exclude-drafts: true
1318           exclude-trivial-rebase: false
1319           exclude-no-code-change: false
1320       - draft-published-event
1321       - comment-added-contains-event:
1322           comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
1323
1324     gerrit_trigger_file_paths:
1325       - compare-type: REG_EXP
1326         pattern: '.*'
1327
1328     # github_included_regions MUST match gerrit_trigger_file_paths
1329     github_included_regions:
1330       - '.*'
1331
1332     #####################
1333     # Job Configuration #
1334     #####################
1335
1336     concurrent: true
1337     disabled: '{disable-job}'
1338
1339     builders:
1340       - lf-infra-pre-build
1341       - lf-jacoco-nojava-workaround
1342       - lf-maven-install:
1343           mvn-version: '{mvn-version}'
1344       - lf-update-java-alternatives:
1345           java-version: '{java-version}'
1346       - lf-provide-maven-settings:
1347           global-settings-file: '{mvn-global-settings}'
1348           settings-file: '{mvn-settings}'
1349       - lf-maven-build:
1350           mvn-goals: '{mvn-goals}'
1351       - lf-provide-maven-settings-cleanup
1352
1353     publishers:
1354       - findbugs
1355       - lf-jacoco-report
1356       - lf-infra-publish
1357
1358 - job-template:
1359     name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
1360     id: gerrit-maven-verify
1361     <<: *lf_maven_common
1362     # yamllint disable-line rule:key-duplicates
1363     <<: *lf_maven_verify
1364
1365     scm:
1366       - lf-infra-gerrit-scm:
1367           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1368           git-url: '{git-url}'
1369           refspec: '$GERRIT_REFSPEC'
1370           branch: '$GERRIT_BRANCH'
1371           submodule-recursive: '{submodule-recursive}'
1372           submodule-timeout: '{submodule-timeout}'
1373           submodule-disable: '{submodule-disable}'
1374           choosing-strategy: gerrit
1375
1376     triggers:
1377       - gerrit:
1378           server-name: '{gerrit-server-name}'
1379           trigger-on: '{obj:gerrit_verify_triggers}'
1380           projects:
1381             - project-compare-type: ANT
1382               project-pattern: '{project}'
1383               branches:
1384                 - branch-compare-type: ANT
1385                   branch-pattern: '**/{branch}'
1386               file-paths: '{obj:gerrit_trigger_file_paths}'
1387
1388 - job-template:
1389     name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
1390     id: github-maven-verify
1391     <<: *lf_maven_common
1392     # yamllint disable-line rule:key-duplicates
1393     <<: *lf_maven_verify
1394
1395     properties:
1396       - lf-infra-properties:
1397           build-days-to-keep: '{build-days-to-keep}'
1398       - github:
1399           url: '{github-url}/{github-org}/{project}'
1400
1401     scm:
1402       - lf-infra-github-scm:
1403           url: '{git-clone-url}{github-org}/{project}'
1404           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1405           branch: '$sha1'
1406           submodule-recursive: '{submodule-recursive}'
1407           submodule-timeout: '{submodule-timeout}'
1408           submodule-disable: '{submodule-disable}'
1409           choosing-strategy: default
1410           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1411
1412     triggers:
1413       - github-pull-request:
1414           trigger-phrase: '^(recheck|reverify)$'
1415           only-trigger-phrase: false
1416           status-context: 'Maven Verify'
1417           permit-all: true
1418           github-hooks: true
1419           white-list-target-branches:
1420             - '{branch}'
1421           included-regions: '{obj:github_included_regions}'
1422
1423 ###########################
1424 # Maven Verify for Docker #
1425 ###########################
1426
1427 - lf_maven_docker_verify: &lf_maven_docker_verify
1428     name: lf-maven-docker-verify
1429
1430     # image push not allowed during verification
1431     mvn-goals: clean install
1432
1433     builders:
1434       - lf-infra-pre-build
1435       - lf-jacoco-nojava-workaround
1436       - lf-maven-install:
1437           mvn-version: '{mvn-version}'
1438       - lf-update-java-alternatives:
1439           java-version: '{java-version}'
1440       - lf-infra-docker-login:
1441           global-settings-file: '{mvn-global-settings}'
1442           settings-file: '{mvn-settings}'
1443       # must provide maven settings AFTER docker due to its cleanup
1444       - lf-provide-maven-settings:
1445           global-settings-file: '{mvn-global-settings}'
1446           settings-file: '{mvn-settings}'
1447       - inject:
1448           properties-content: |
1449               CONTAINER_PULL_REGISTRY={container-public-registry}
1450       - lf-maven-build:
1451           mvn-goals: '{mvn-goals}'
1452       - lf-provide-maven-settings-cleanup
1453
1454 - job-template:
1455     name: '{project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}'
1456     id: gerrit-maven-docker-verify
1457     <<: *lf_maven_common
1458     # yamllint disable-line rule:key-duplicates
1459     <<: *lf_maven_verify
1460     # yamllint disable-line rule:key-duplicates
1461     <<: *lf_maven_docker_verify
1462
1463     scm:
1464       - lf-infra-gerrit-scm:
1465           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1466           git-url: '{git-url}'
1467           refspec: '$GERRIT_REFSPEC'
1468           branch: '$GERRIT_BRANCH'
1469           submodule-recursive: '{submodule-recursive}'
1470           submodule-timeout: '{submodule-timeout}'
1471           submodule-disable: '{submodule-disable}'
1472           choosing-strategy: gerrit
1473
1474     triggers:
1475       - gerrit:
1476           server-name: '{gerrit-server-name}'
1477           trigger-on: '{obj:gerrit_verify_triggers}'
1478           projects:
1479             - project-compare-type: ANT
1480               project-pattern: '{project}'
1481               branches:
1482                 - branch-compare-type: ANT
1483                   branch-pattern: '**/{branch}'
1484               file-paths: '{obj:gerrit_trigger_file_paths}'
1485
1486 - job-template:
1487     name: '{project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}'
1488     id: github-maven-docker-verify
1489     <<: *lf_maven_common
1490     # yamllint disable-line rule:key-duplicates
1491     <<: *lf_maven_verify
1492     # yamllint disable-line rule:key-duplicates
1493     <<: *lf_maven_docker_verify
1494
1495     properties:
1496       - lf-infra-properties:
1497           build-days-to-keep: '{build-days-to-keep}'
1498       - github:
1499           url: '{github-url}/{github-org}/{project}'
1500
1501     scm:
1502       - lf-infra-github-scm:
1503           url: '{git-clone-url}{github-org}/{project}'
1504           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1505           branch: '$sha1'
1506           submodule-recursive: '{submodule-recursive}'
1507           submodule-timeout: '{submodule-timeout}'
1508           submodule-disable: '{submodule-disable}'
1509           choosing-strategy: default
1510           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1511
1512     triggers:
1513       - github-pull-request:
1514           trigger-phrase: '^(recheck|reverify)$'
1515           only-trigger-phrase: false
1516           status-context: 'Maven Docker Verify'
1517           permit-all: true
1518           github-hooks: true
1519           white-list-target-branches:
1520             - '{branch}'
1521           included-regions: '{obj:github_included_regions}'
1522
1523 #############################
1524 # Maven Verify Dependencies #
1525 #############################
1526
1527 - lf_maven_verify_dependencies: &lf_maven_verify_dependencies
1528     name: lf-maven-verify-dependencies
1529
1530     ######################
1531     # Default parameters #
1532     ######################
1533
1534     branch: master
1535     build-days-to-keep: 7
1536     build-timeout: 60
1537     disable-job: false
1538     git-url: '$GIT_URL/$PROJECT'
1539     github-url: 'https://github.com'
1540     java-version: openjdk8
1541     mvn-global-settings: global-settings
1542     mvn-goals: clean deploy
1543     mvn-opts: ''
1544     mvn-params: '-Dstream=$STREAM'
1545     mvn-version: mvn35
1546     stream: master
1547     submodule-recursive: true
1548     submodule-timeout: 10
1549     submodule-disable: false
1550
1551     gerrit_verify_triggers:
1552       - comment-added-contains-event:
1553           comment-contains-value: 'recheck: [0-9 ]+'
1554     gerrit_trigger_file_paths:
1555       - compare-type: ANT
1556         pattern: '**'
1557
1558     #####################
1559     # Job Configuration #
1560     #####################
1561
1562     concurrent: true
1563     disabled: '{disable-job}'
1564
1565     builders:
1566       - lf-infra-pre-build
1567       - lf-jacoco-nojava-workaround
1568       - lf-maven-install:
1569           mvn-version: '{mvn-version}'
1570       - lf-update-java-alternatives:
1571           java-version: '{java-version}'
1572       - lf-provide-maven-settings:
1573           global-settings-file: '{mvn-global-settings}'
1574           settings-file: '{mvn-settings}'
1575       - lf-fetch-dependent-patches
1576       - shell: !include-raw-escape:
1577           - ../shell/common-variables.sh
1578           - ../shell/maven-build-deps.sh
1579       - lf-maven-build:
1580           mvn-goals: '{mvn-goals}'
1581       - lf-provide-maven-settings-cleanup
1582
1583     publishers:
1584       - findbugs
1585       - lf-jacoco-report
1586       - lf-infra-publish
1587
1588 - job-template:
1589     name: '{project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}'
1590     id: gerrit-maven-verify-dependencies
1591     <<: *lf_maven_common
1592     # yamllint disable-line rule:key-duplicates
1593     <<: *lf_maven_verify_dependencies
1594
1595     scm:
1596       - lf-infra-gerrit-scm:
1597           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1598           git-url: '{git-url}'
1599           refspec: '$GERRIT_REFSPEC'
1600           branch: '$GERRIT_BRANCH'
1601           submodule-recursive: '{submodule-recursive}'
1602           submodule-timeout: '{submodule-timeout}'
1603           submodule-disable: '{submodule-disable}'
1604           choosing-strategy: gerrit
1605
1606     triggers:
1607       - gerrit:
1608           server-name: '{gerrit-server-name}'
1609           trigger-on: '{obj:gerrit_verify_triggers}'
1610           projects:
1611             - project-compare-type: ANT
1612               project-pattern: '{project}'
1613               branches:
1614                 - branch-compare-type: ANT
1615                   branch-pattern: '**/{branch}'
1616               file-paths: '{obj:gerrit_trigger_file_paths}'