summaryrefslogtreecommitdiffstats
path: root/jjb/global-templates-java.yaml
blob: ff021db1cd52d95fe9ab8e457a8f1266ba4d8d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #a6e22e } /* Name.Function.Magic */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
}
@media (prefers-color-scheme: light) {
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
}
<!--
  ============LICENSE_START=======================================================
   Copyright (C) 2018 Ericsson. All rights reserved.
  ================================================================================
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

  SPDX-License-Identifier: Apache-2.0
  ============LICENSE_END=========================================================
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.onap.policy.apex-pdp.model</groupId>
        <artifactId>model</artifactId>
        <version>2.0.0-SNAPSHOT</version>
    </parent>
    <artifactId>utilities</artifactId>


    <dependencies>
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-runtime</artifactId>
            <version>4.7.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4-maven-plugin</artifactId>
                <version>4.7.1</version>
                <executions>
                    <execution>
                        <id>antlr-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>antlr4</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
f='#n505'>505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108
---
- job-template: &verify_java_defaults
    # Job template for Java verify jobs
    #
    # The purpose of this job template is to run:
    # 1. maven clean install
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    name: '{project-name}-{stream}-verify-java'

    project-type: freestyle
    concurrent: true
    node: '{build-node}'
    build-env-variables: ''
    pattern: '**'
    pom:
    mvn-opts: ''
    java-opts: ''
    java-version: openjdk8
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'
      - maven-params:
          mvn-params: '{mvn-params}'

    scm:
      - gerrit-trigger-scm:
          refspec: '$GERRIT_REFSPEC'
          choosing-strategy: 'gerrit'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      - gerrit-trigger-patch-submitted:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'
          files: '{obj:pattern}'

    builders:
      - lf-infra-pre-build
      - lf-update-java-alternatives:
          java-version: "{java-version}"
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'
      - inject:
          properties-content: "{build-env-variables}"
      - maven-target:
          maven-version: '{maven-version}'
          pom: '{obj:pom}'
          goals: 'clean install -B
            -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn {mvn-params}'
          properties:
            - MAVEN_OPTS='{mvn-opts}'
          java-opts:
            - "{java-opts}"
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp

    publishers:
      - lf-infra-publish

- job-template:
    # Job template for Java verify jobs running checkstyle at the end
    # When checkstyle will be fully incorporated, it is meant to replace
    #  '{project-name}-{stream}-verify-java-checkstyle'
    #
    # The purpose of this job template is to run:
    # 1. maven clean install
    #
    # This job publishes checkstyle results.
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    <<: *verify_java_defaults
    name: '{project-name}-{stream}-verify-java-checkstyle'

    publishers:
      - lf-infra-publish
      - checkstyle-result

- job-template:
    # Job template for Java verify jobs with POM not at the root
    #
    # The purpose of this job template is to run:
    # 1. maven clean install
    #
    # This job supports subprojects.
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)
    #     pom:       name/location of the pom.xml file relative to the workspace
    #     pattern:   ant file-path pattern relative to the workspace used to
    #                trigger the job

    <<: *verify_java_defaults
    name: '{project-name}-{stream}-{subproject}-verify-java'

- job-template:
    # Job template for Java integration pairwise jobs
    #
    # The purpose of this job template is to run:
    # 1. maven clean install
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    <<: *verify_java_defaults
    name: '{project-name}-{stream}-integration-pairwise'
    triggers:
      - timed: '@daily'
      - gerrit-trigger-patch-submitted:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'
          files: '{obj:pattern}'

- job-template:
    # Job template for Java daily release jobs running checkstyle at the end
    # When checkstyle will be fully incorporated, it is meant to replace
    #  '{project-name}-{stream}-release-java-daily'
    #
    # The purpose of this job template is to run:
    # 1. maven clean deploy with Sonar scans
    #
    # This job publishes checkstyle results.
    # This job uses a conditional regex match step to set versions.
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    name: '{project-name}-{stream}-release-java-daily-checkstyle'
    project-type: freestyle
    node: '{build-node}'
    disabled: '{disabled}'
    maven-deploy-properties:
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'
    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'
    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'
    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'
    triggers:
      # 11 AM UTC
      - timed: '@daily'
      - gerrit-trigger-release-manually:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'
    builders:
      - lf-infra-pre-build
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'
      - conditional-step:
          condition-kind: regex-match
          regex: DoSetVersion
          label: '{setVersion}'
          steps:
            - inject:
                properties-file: version.properties
            - maven-set-release-version:
                maven-version: '{maven-version}'
                mvn-settings: '{mvn-settings}'
                pom:
      - maven-target:
          maven-version: '{maven-version}'
          goals: 'clean deploy -B
            -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
          properties: '{obj:mvn_properties}'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp

    publishers:
      - lf-infra-publish
      - checkstyle-result-daily

- job-template:
    # Job template for Java daily release jobs
    #
    # The purpose of this job template is to run:
    # 1. maven set versions
    # 2. maven clean deploy with Sonar scans
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    name: '{project-name}-{stream}-release-version-java-daily'

    project-type: freestyle
    disabled: '{disabled}'
    node: '{build-node}'
    maven-deploy-properties:
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      # 11 AM UTC
      - timed: '@daily'
      - gerrit-trigger-release-manually:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'

    builders:
      - lf-infra-pre-build
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - inject:
          properties-file: version.properties
      - maven-set-release-version:
          maven-version: '{maven-version}'
          mvn-settings: '{mvn-settings}'
          pom:

      - maven-target:
          maven-version: '{maven-version}'
          goals: 'clean deploy -B
            -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
          properties:
            - '{maven-deploy-properties}'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp

    publishers:
      - lf-infra-publish

- job-template: &merge_java_defaults
    # Job template for Java merge jobs
    #
    # The purpose of this job template is to run:
    # 1. maven clean deploy
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    name: '{project-name}-{stream}-merge-java'

    project-type: freestyle
    node: '{build-node}'
    pattern: '**'
    pom:
    mvn_properties: []
    mvn-params: ''
    mvn-opts: ''
    java-opts: ''
    java-version: openjdk8

    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - lf-infra-wrappers:
          build-timeout: '{build-timeout}'
          jenkins-ssh-credential: '{jenkins-ssh-credential}'

    triggers:
      - gerrit-trigger-patch-merged:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'
          files: '{pattern}'

    builders:
      - lf-infra-pre-build
      - lf-update-java-alternatives:
          java-version: "{java-version}"
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'
      - conditional-step:
          condition-kind: regex-match
          regex: .*(amd64|arm64).*
          label: '{project-name}'
          steps:
            - shell: !include-raw-escape: global-jjb/shell/docker-login.sh
      - maven-target:
          maven-version: '{maven-version}'
          pom: '{obj:pom}'
          goals: 'clean deploy -B {mvn-params}
            -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
          properties:
            - MAVEN_OPTS='{mvn-opts}'
          java-opts:
            - "{java-opts}"
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp
          properties: '{obj:mvn_properties}'

    publishers:
      - lf-infra-publish

- job-template:
    # Job template for Java merge jobs based on
    #   '{project-name}-{stream}-merge-java'
    # The purpose of this job template is to run:
    # 1. maven clean deploy
    #
    # This project supports maven properties.
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)
    #     maven-properties: properties passed to maven

    <<: *merge_java_defaults
    name: '{project-name}-{stream}-merge-properties-java'

    wrappers:
      - lf-infra-wrappers:
          build-timeout: '{build-timeout}'
          jenkins-ssh-credential: '{jenkins-ssh-credential}'

- job-template:
    # Job template for Java merge jobs that takes a maven template
    #
    # The purpose of this job template is to run:
    # 1. maven clean deploy -P {mvn-profile}
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    <<: *merge_java_defaults
    name: '{project-name}-{stream}-merge-profile-java'

    builders:
      - lf-infra-pre-build
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - docker-login

      - maven-target:
          maven-version: '{maven-version}'
          goals: 'clean deploy -P {mvn-profile} -B
            -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp
          properties:
            - docker.pull.registry=nexus3.onap.org:10001
            - docker.push.registry=nexus3.onap.org:10003

- job-template:
    # Job template for Java merge jobs with POM not at the root
    #
    # The purpose of this job template is to run:
    # 1. maven clean deploy
    #
    # This job supports subprojects.
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)
    #     pom:       name/location of the pom.xml file relative to the workspace
    #     pattern:   ant file-path pattern relative to the workspace used to
    #                trigger the job

    <<: *merge_java_defaults
    name: '{project-name}-{stream}-{subproject}-merge-java'

- job-template: &docker_java_defaults
    # Job template for Docker daily jobs
    #
    # The purpose of this job template is to run:
    # 1. login to the docker registry
    # 2. docker push
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    name: '{project-name}-{stream}-docker-java-daily'
    id: '{project-name}-{stream}-docker-java-daily'
    project-type: freestyle
    node: '{build-node}'
    disabled: '{disabled}'
    java-version: openjdk8
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'
      - maven-params:
          mvn-params: '{mvn-params}'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      # 12 AM UTC
      - timed: '@daily'
      - gerrit-trigger-release-manually:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'

    builders:
      - lf-infra-pre-build
      - lf-update-java-alternatives:
          java-version: "{java-version}"

      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - docker-login

      - maven-docker-push-daily:
          maven-version: '{maven-version}'
          mvn-settings: '{mvn-settings}'
          pom: '{docker-pom}'
          # use default as mvn-profile if profile is not needed
          mvn-profile: '{mvn-profile}'
          mvn-params: '{mvn-params}'

    publishers:
      - lf-infra-publish

- job-template:
    # Job template for Docker daily jobs
    #
    # The purpose of this job template is to run:
    # 1. login to the docker registry
    # 2. docker push
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    <<: *docker_java_defaults
    name: '{project-name}-{stream}-docker-java-daily'
    id: docker-java-daily
    node: '{build-node}'
    wrappers:
      - infra-wrappers-docker-build:
          build-timeout: '{build-timeout}'

- job-template:
    # Job template for building & pushing docker images
    #
    # The purpose of this job template is to run:
    #  1. login to the docker registry
    #  2. run a specified shell builder
    #
    # Required Variables:
    #     pom:       name/location of the pom.xml file relative to the workspace
    #     maven-properties: properties passed to maven

    name: '{project-name}-{stream}-docker-java-shell-daily'
    project-type: freestyle
    node: '{build-node}'
    disabled: '{disabled}'
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      # 12 AM UTC
      - timed: '@daily'
      - gerrit-trigger-release-manually:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'

    builders:
      - lf-infra-pre-build
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - docker-login

      - maven-target:
          maven-version: '{maven-version}'
          goals: '{mvn-goals}'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp

      - shell: '{script}'

    publishers:
      - lf-infra-publish

- job-template:
    # Job template for building & pushing docker images
    #
    # The purpose of this job template is to run:
    #  1. login to the docker registry
    #  2. run a specified shell builder
    #
    # Required Variables:
    #     pom:       name/location of the pom.xml file relative to the workspace
    #     maven-properties: properties passed to maven

    name: '{project-name}-{stream}-{subproject}-docker-java-shell-daily'
    project-type: freestyle
    node: '{build-node}'
    disabled: '{disabled}'
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      # 12 AM UTC
      - timed: '@daily'
      - gerrit-trigger-release-manually:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'

    builders:
      - lf-infra-pre-build
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - docker-login

      - maven-target:
          maven-version: '{maven-version}'
          pom: '{pom}'
          goals: '{mvn-goals}'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp

      - shell: '{script}'

    publishers:
      - lf-infra-publish

- job-template:
    # Job template for building & pushing docker images
    #
    # The purpose of this job template is to run:
    #  1. login to the docker registry
    #  2. inject a version.properties file and set versions
    #  3. run a specified shell builder
    #
    # Required Variables:
    #     pom:       name/location of the pom.xml file relative to the workspace
    #     maven-properties: properties passed to maven

    name: '{project-name}-{stream}-docker-java-version-shell-daily'
    project-type: freestyle
    node: '{build-node}'
    disabled: '{disabled}'
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      # 12 AM UTC
      - timed: '@daily'
      - gerrit-trigger-release-manually:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'

    builders:
      - lf-infra-pre-build
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - inject:
          properties-file: version.properties
      - maven-set-release-version:
          maven-version: '{maven-version}'
          mvn-settings: '{mvn-settings}'
          pom:

      - docker-login

      - maven-target:
          maven-version: '{maven-version}'
          goals: '{mvn-goals}'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp

      - shell: '{script}'

    publishers:
      - lf-infra-publish

- job-template:
    # Job template for building & pushing docker images
    #
    # The purpose of this job template is to run:
    #  1. login to the docker registry
    #  2. inject a version.properties file and set versions
    #  3. run a specified shell builder
    #
    # This template supports subprojects.
    #
    # Required Variables:
    #     pom:       name/location of the pom.xml file relative to the workspace
    #     maven-properties: properties passed to maven

    name: '{project-name}-{stream}-{subproject}-docker-java-version-shell-daily'
    project-type: freestyle
    node: 'ubuntu1804-docker-8c-8g'
    disabled: '{disabled}'
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      # 12 AM UTC
      - timed: '@daily'
      - gerrit-trigger-release-manually:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'

    builders:
      - lf-infra-pre-build
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - inject:
          properties-file: version.properties
      - maven-set-release-version:
          maven-version: '{maven-version}'
          mvn-settings: '{mvn-settings}'
          pom: '{pom}'

      - docker-login

      - maven-target:
          maven-version: '{maven-version}'
          pom: '{pom}'
          goals: '{mvn-goals}'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp

      - shell: '{script}'

    publishers:
      - lf-infra-publish

- job-template: &docker_version_java_defaults
    # Job template for building & pushing docker images
    #
    # The purpose of this job template is to run:
    #  1. login to the docker registry
    #  2. inject a version.properties file and set versions
    #  3. run a docker push
    #
    # Required Variables:
    #     pom:       name/location of the pom.xml file relative to the workspace
    #     profile:   the docker profile defined in the pom
    #     maven-properties: properties passed to maven

    name: '{project-name}-{stream}-docker-version-java-daily'
    id: '{project-name}-{stream}-docker-version-java-daily'
    project-type: freestyle
    node: '{build-node}'
    disabled: '{disabled}'
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'
      - maven-params:
          mvn-params: '{mvn-params}'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      # 12 AM UTC
      - timed: '@daily'
      - gerrit-trigger-release-manually:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'

    builders:
      - lf-infra-pre-build
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - inject:
          properties-file: version.properties
      - maven-set-release-version:
          maven-version: '{maven-version}'
          mvn-settings: '{mvn-settings}'
          pom:

      - docker-login

      - maven-docker-push-daily:
          maven-version: '{maven-version}'
          mvn-settings: '{mvn-settings}'
          pom: '{docker-pom}'
          # use default as mvn-profile if profile is not needed
          mvn-profile: '{mvn-profile}'
          mvn-params: '{mvn-params}'

    publishers:
      - lf-infra-publish

- job-template:
    # Job template for building & pushing docker images
    #
    # The purpose of this job template is to run:
    #  1. login to the docker registry
    #  2. inject a version.properties file and set versions
    #  3. run a docker push
    #
    # Required Variables:
    #     pom:       name/location of the pom.xml file relative to the workspace
    #     profile:   the docker profile defined in the pom
    #     maven-properties: properties passed to maven

    <<: *docker_version_java_defaults
    name: '{project-name}-{stream}-docker-version-java-daily'
    id: 'docker-version-java-daily'
    node: '{build-node}'
    wrappers:
      - infra-wrappers-docker-build:
          build-timeout: '{build-timeout}'

- job-template:
    # Job template for building & pushing docker images for AAI specific repos
    #
    # The purpose of this job template is to run:
    #  1. login to the docker registry
    #  2. run maven goals
    #  3. run include-docker-push.sh
    #
    # Required Variables:
    #     pom:       name/location of the pom.xml file relative to the workspace
    #     maven-properties: properties passed to maven

    name: '{project-name}-{stream}-aai-docker-java-daily'
    project-type: freestyle
    node: '{build-node}'
    docker-image-name: ''
    disabled: '{disabled}'
    java-version: 'openjdk8'
    properties:
      - infra-properties:
          build-days-to-keep: '{build-days-to-keep}'

    parameters:
      - infra-parameters:
          project: '{project}'
          branch: '{branch}'
          refspec: 'refs/heads/{branch}'
          artifacts: '{archive-artifacts}'
      - maven-exec:
          maven-version: '{maven-version}'
      - docker-image-name:
          docker-image-name: '{docker-image-name}'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      # 12 AM UTC
      - timed: '@daily'
      - gerrit-trigger-release-manually:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'

    builders:
      - lf-infra-pre-build
      - lf-update-java-alternatives:
          java-version: "{java-version}"
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - docker-login

      - maven-target:
          maven-version: '{maven-version}'
          pom: 'pom.xml'
          goals: 'clean install -DskipTests -B
            -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp

      - maven-target:
          maven-version: '{maven-version}'
          pom: '{pom}'
          goals: '{mvn-goals}'
          settings: '{mvn-settings}'
          settings-type: cfp
          global-settings: 'global-settings'
          global-settings-type: cfp
          properties:
            - maven.test.skip=true
            - docker.pull.registry=nexus3.onap.org:10001
            - docker.push.registry=nexus3.onap.org:10003

      - shell: !include-raw-escape: include-docker-push.sh

    publishers:
      - lf-infra-publish

- job-template:
    # Job template for Java merge jobs for SDC specific repos
    #
    # The purpose of this job template is to run:
    # 1. maven clean deploy
    #
    # Required Variables:
    #     branch:    git branch (eg. stable/lithium or master)

    <<: *merge_java_defaults
    name: '{project-name}-{stream}-sdc-merge-java'

    node: '{build-node}'
    build-timeout: 120

    builders:
      - lf-infra-pre-build
      - lf-update-java-alternatives:
          java-version: "{java-version}"
      - provide-maven-settings:
          global-settings-file: 'global-settings'
          settings-file: '{mvn-settings}'

      - docker-login

      - maven-docker-push-daily:
          maven-version: '{maven-version}'
          mvn-settings: '{mvn-settings}'
          pom: '{docker-pom}'
          # use default as mvn-profile if profile is not needed
          mvn-profile: '{mvn-profile}'
          mvn-params: ''

- job-template:
    # Job template for Java merge jobs on multiple architectures
    #
    # The purpose of this job template is to:
    # 1. Run parallel {project-name}-{stream}-verify-java jobs for each supported architecture
    # 2. Build and push a docker manifest list for the images created by
    #    the previous jobs

    name: '{project-name}-multiarch-{stream}-merge-java'
    node: '{build-node}'
    project-type: multijob
    disabled: '{obj:disabled}'
    pattern: '**'

    parameters:
      - lf-infra-parameters:
          project: '{project}'
          stream: '{stream}'
          branch: '{branch}'
      - string:
          name: DOCKER_REGISTRY
          default: 'none'
      - string:
          name: DOCKERHUB_REGISTRY
          default: 'registry-1.docker.io'

    properties:
      - throttle:
          max-per-node: 1
          option: 'project'
      - build-blocker:
          use-build-blocker: true
          blocking-jobs:
            - '{project-name}-.*-merge-.*'
          blocking-level: 'NODE'

    scm:
      - gerrit-trigger-scm:
          refspec: ''
          choosing-strategy: 'default'
          submodule-recursive: '{submodule-recursive}'

    wrappers:
      - infra-wrappers:
          build-timeout: '{build-timeout}'

    triggers:
      - gerrit-trigger-patch-merged:
          server: '{server-name}'
          project: '{project}'
          branch: '{branch}'
          files: '{pattern}'

    builders:
      - multijob:
          name: 'build docker images'
          condition: ALWAYS
          execution-type: PARALLEL
          projects:
            - name: '{project-name}-amd64-{stream}-merge-java'
              kill-phase-on: FAILURE
              current-parameters: true
            - name: '{project-name}-arm64-{stream}-merge-java'
              kill-phase-on: NEVER
              current-parameters: true
      - multijob:
          name: 'publish docker manifest'
          condition: SUCCESSFUL
          execution-type: PARALLEL
          projects:
            - name: '{project-name}-docker-manifest-{stream}'
              current-parameters: true
              predefined-parameters: |
                PARENT_JOB_NAME=$JOB_NAME
                DOCKERHUB_REGISTRY=docker.io