Fix deprecation warning to not execute code
[releng/global-jjb.git] / docs / jjb / lf-maven-jobs.rst
index 9b94533..6144e05 100644 (file)
@@ -5,58 +5,62 @@ Maven Jobs
 Job Groups
 ==========
 
-{project-name}-maven-jobs
--------------------------
+.. include:: ../job-groups.rst
 
-Jobs for Maven projects using Gerrit.
+Below is a list of Maven job groups:
 
-:Includes:
+.. literalinclude:: ../../jjb/lf-maven-job-groups.yaml
+   :language: yaml
 
-    - gerrit-maven-clm
-    - gerrit-maven-release
-    - gerrit-maven-verify
-    - gerrit-maven-verify-dependencies
 
-{project-name}-github-maven-jobs
---------------------------------
+Macros
+======
 
-Jobs for Maven projects using GitHub.
+lf-infra-maven-sonar
+--------------------
 
-:Includes:
+Runs Sonar against a Maven project.
 
-    - github-maven-clm
-    - github-maven-release
-    - github-maven-verify
+:Required Parameters:
 
-{project-name}-maven-javadoc-jobs
----------------------------------
+    :java-version: Version of Java to execute Sonar with.
+    :mvn-version: Version of Maven to execute Sonar with.
+    :mvn-settings: Maven settings.xml file containing credentials to use.
 
-Jobs for Maven projects to generate javadoc using Gerrit.
+lf-maven-build
+--------------
 
-:Includes:
+Calls the maven build script to perform a maven build.
 
-    - gerrit-maven-javadoc-publish
-    - gerrit-maven-javadoc-verify
+:Required parameters:
 
-{project-name}-github-maven-javadoc-jobs
-----------------------------------------
+    :mvn-goals: The maven goals to perform for the build.
+        (default: clean deploy)
 
-Jobs for Maven projects to generate javadoc using GitHub.
+lf-maven-common
+---------------
 
-:Includes:
+Common Jenkins configuration for Maven jobs.
 
-    - github-maven-javadoc-publish
-    - github-maven-javadoc-verify
+lf-maven-deploy
+---------------
 
+Calls the maven deploy script to push artifacts to Nexus.
 
-Macros
-======
-
-lf-maven-common
+lf-maven-stage
 ---------------
 
-Common Jenkins configuration for Maven jobs.
+Calls the maven stage script to push artifacts to a Nexus staging repository.
+
+lf-update-java-alternatives
+---------------------------
+
+Setup Java alternatives for the Distro.
 
+:Required Parameters:
+
+    :java-version: Version of Java to set as the default Java.
+        Eg. openjdk8
 
 Job Templates
 =============
@@ -72,6 +76,8 @@ Produces a CLM scan of the code into Nexus IQ Server.
     - gerrit-maven-clm
     - github-maven-clm
 
+:Comment Trigger: run-clm
+
 :Required parameters:
 
     :build-node:    The node to run build on.
@@ -83,14 +89,16 @@ Produces a CLM scan of the code into Nexus IQ Server.
 
     :branch: The branch to build against. (default: master)
     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
-    :build-timeout: Timeout in seconds before aborting build. (default: 60)
+    :build-timeout: Timeout in minutes before aborting build. (default: 60)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
     :java-version: Version of Java to use for the build. (default: openjdk8)
     :mvn-global-settings: The name of the Maven global settings to use for
         Maven configuration. (default: global-settings)
     :mvn-opts: Sets MAVEN_OPTS. (default: '')
     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
-    :mvn-version: Version of maven to use. (default: mvn33)
+    :mvn-version: Version of maven to use. (default: mvn35)
+    :nexus-iq-stage: Stage the policy evaluation will be run against on
+        the Nexus IQ Server. (default: 'build')
     :stream: Keyword that can be used to represent a release code-name.
         Often the same as the branch. (default: master)
     :submodule-recursive: Whether to checkout submodules recursively.
@@ -111,6 +119,8 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs
     - gerrit-maven-javadoc-publish
     - github-maven-javadoc-publish
 
+:Comment Trigger: remerge
+
 :Required parameters:
 
     :build-node: The node to run build on.
@@ -125,14 +135,14 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs
 
     :branch: The branch to build against. (default: master)
     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
-    :build-timeout: Timeout in seconds before aborting build. (default: 60)
+    :build-timeout: Timeout in minutes before aborting build. (default: 60)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
     :java-version: Version of Java to use for the build. (default: openjdk8)
     :mvn-global-settings: The name of the Maven global settings to use for
         Maven configuration. (default: global-settings)
     :mvn-opts: Sets MAVEN_OPTS. (default: '')
     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
-    :mvn-version: Version of maven to use. (default: mvn33)
+    :mvn-version: Version of maven to use. (default: mvn35)
     :stream: Keyword that can be used to represent a release code-name.
         Often the same as the branch. (default: master)
     :submodule-recursive: Whether to checkout submodules recursively.
@@ -153,6 +163,8 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs
     - gerrit-maven-javadoc-verify
     - github-maven-javadoc-verify
 
+:Comment Trigger: recheck|reverify
+
 :Required parameters:
     :build-node:    The node to run build on.
     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
@@ -163,7 +175,7 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs
 
     :branch: The branch to build against. (default: master)
     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
-    :build-timeout: Timeout in seconds before aborting build. (default: 60)
+    :build-timeout: Timeout in minutes before aborting build. (default: 60)
     :deploy-path:    The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
     :java-version: Version of Java to use for the build. (default: openjdk8)
@@ -171,7 +183,7 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs
         Maven configuration. (default: global-settings)
     :mvn-opts: Sets MAVEN_OPTS. (default: '')
     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
-    :mvn-version: Version of maven to use. (default: mvn33)
+    :mvn-version: Version of maven to use. (default: mvn35)
     :stream: Keyword that can be used to represent a release code-name.
         Often the same as the branch. (default: master)
     :submodule-recursive: Whether to checkout submodules recursively.
@@ -179,19 +191,84 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs
 
     :gerrit_verify_triggers: Override Gerrit Triggers.
 
-Maven Release
--------------
+Maven Merge
+-----------
+
+Merge job which runs `mvn clean deploy` to build a project.
+
+This job pushes files to Nexus using cURL instead of allowing the Maven deploy
+goal to push the upload. This is to get around the issue that Maven deploy does
+not properly support uploading files at the end of the build and instead pushes
+as it goes. There exists a `-Ddeploy-at-end` feature however it does not work
+with extensions.
+
+This job uses the following strategy to deploy jobs to Nexus:
+
+1. `wget -r` to fetch maven-metadata.xml from Nexus
+2. `mvn deploy -DaltDeploymentRepository` to prepare files for upload
+3. Removes untouched maven-metadata.xml files before upload
+4. Use lftools (cURL) upload script to push artifacts to Nexus
+
+:Template Names:
+
+    - {project-name}-maven-merge-{stream}
+    - gerrit-maven-merge
+    - github-maven-merge
+
+:Comment Trigger: remerge
+
+:Required parameters:
+
+    :build-node: The node to run build on.
+    :jenkins-ssh-credential: Credential to use for SSH. (Generally should
+        be configured in defaults.yaml)
+    :mvn-settings: The name of settings file containing credentials for the project.
+    :mvn-snapshot-id: Maven Server ID from settings.xml to pull credentials from.
+        (Note: This setting should be configured in defaults.yaml.)
+    :nexus-snapshot-repo: The repository id of the Nexus snapshot repo to deploy to.
+
+:Optional parameters:
+
+    :branch: Git branch to fetch for the build. (default: master)
+    :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
+    :build-timeout: Timeout in minutes before aborting build. (default: 60)
+    :cron: Cron schedule when to trigger the job. This parameter also
+        supports multiline input via YAML pipe | character in cases where
+        one may want to provide more than 1 cron timer. (default: 'H H * * 0'
+        to run weekly)
+    :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
+    :java-version: Version of Java to use for the build. (default: openjdk8)
+    :mvn-global-settings: The name of the Maven global settings to use for
+        Maven configuration. (default: global-settings)
+    :mvn-opts: Sets MAVEN_OPTS. (default: '')
+    :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
+    :mvn-version: Version of maven to use. (default: mvn35)
+    :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`.
+    :stream: Keyword that can be used to represent a release code-name.
+        Often the same as the branch. (default: master)
+    :submodule-recursive: Whether to checkout submodules recursively.
+        (default: true)
+
+    :gerrit_merge_triggers: Override Gerrit Triggers.
+    :gerrit_trigger_file_paths: Override file paths which can be used to
+        filter which file modifications will trigger a build.
+
+Maven Stage
+-----------
 
 Produces a release candidate by creating a staging repo in Nexus.
 
-Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
-directory can then be reused later to deploy to Nexus.
+The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234",
+"autorelease-2000", "odlparent-1201", etc...
+
+This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
+directory is then used later to deploy to Nexus.
 
 :Template Names:
 
-    - {project-name}-maven-release-{stream}
-    - gerrit-maven-release
-    - github-maven-release
+    - {project-name}-maven-stage-{stream}
+    - gerrit-maven-stage
+    - github-maven-stage
 
 :Required parameters:
 
@@ -205,10 +282,10 @@ directory can then be reused later to deploy to Nexus.
 
 :Optional parameters:
 
-    :archive-artifacts: Artifacts to archive to the logs server (default: ''). 
+    :archive-artifacts: Artifacts to archive to the logs server (default: '').
     :branch: The branch to build against. (default: master)
     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
-    :build-timeout: Timeout in seconds before aborting build. (default: 60)
+    :build-timeout: Timeout in minutes before aborting build. (default: 60)
     :cron: Cron schedule when to trigger the job. This parameter also
         supports multiline input via YAML pipe | character in cases where
         one may want to provide more than 1 cron timer. (default: '')
@@ -219,7 +296,8 @@ directory can then be reused later to deploy to Nexus.
         Maven configuration. (default: global-settings)
     :mvn-opts: Sets MAVEN_OPTS. (default: '')
     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
-    :mvn-version: Version of maven to use. (default: mvn33)
+    :mvn-version: Version of maven to use. (default: mvn35)
+    :sign-artifacts: Sign artifacts with Sigul. (default: false)
     :stream: Keyword that can be used to represent a release code-name.
         Often the same as the branch. (default: master)
     :submodule-recursive: Whether to checkout submodules recursively.
@@ -242,6 +320,8 @@ interest in that kind of support.
     - gerrit-maven-sonar
     - github-maven-sonar
 
+:Comment Trigger: run-sonar
+
 :Required parameters:
 
     :build-node: The node to run build on.
@@ -252,14 +332,18 @@ interest in that kind of support.
 :Optional parameters:
 
     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
-    :build-timeout: Timeout in seconds before aborting build. (default: 60)
+    :build-timeout: Timeout in minutes before aborting build. (default: 60)
+    :cron: Cron schedule when to trigger the job. This parameter also
+        supports multiline input via YAML pipe | character in cases where
+        one may want to provide more than 1 cron timer.  (default: 'H H * * 6'
+        to run weekly)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
     :java-version: Version of Java to use for the build. (default: openjdk8)
     :mvn-global-settings: The name of the Maven global settings to use for
         Maven configuration. (default: global-settings)
     :mvn-opts: Sets MAVEN_OPTS. (default: '')
     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
-    :mvn-version: Version of maven to use. (default: mvn33)
+    :mvn-version: Version of maven to use. (default: mvn35)
     :stream: Keyword that can be used to represent a release code-name.
         Often the same as the branch. (default: master)
     :submodule-recursive: Whether to checkout submodules recursively.
@@ -278,6 +362,8 @@ Verify job which runs mvn clean install to test a project build..
     - gerrit-maven-verify
     - github-maven-verify
 
+:Comment Trigger: recheck|reverify
+
 :Required parameters:
 
     :build-node: The node to run build on.
@@ -289,14 +375,14 @@ Verify job which runs mvn clean install to test a project build..
 
     :branch: Git branch to fetch for the build. (default: master)
     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
-    :build-timeout: Timeout in seconds before aborting build. (default: 60)
+    :build-timeout: Timeout in minutes before aborting build. (default: 60)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
     :java-version: Version of Java to use for the build. (default: openjdk8)
     :mvn-global-settings: The name of the Maven global settings to use for
         Maven configuration. (default: global-settings)
     :mvn-opts: Sets MAVEN_OPTS. (default: '')
     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
-    :mvn-version: Version of maven to use. (default: mvn33)
+    :mvn-version: Version of maven to use. (default: mvn35)
     :stream: Keyword that can be used to represent a release code-name.
         Often the same as the branch. (default: master)
     :submodule-recursive: Whether to checkout submodules recursively.
@@ -333,14 +419,14 @@ via comment trigger.
 
     :branch: Git branch to fetch for the build. (default: master)
     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
-    :build-timeout: Timeout in seconds before aborting build. (default: 60)
+    :build-timeout: Timeout in minutes before aborting build. (default: 60)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
     :java-version: Version of Java to use for the build. (default: openjdk8)
     :mvn-global-settings: The name of the Maven global settings to use for
         Maven configuration. (default: global-settings)
     :mvn-opts: Sets MAVEN_OPTS. (default: '')
     :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
-    :mvn-version: Version of maven to use. (default: mvn33)
+    :mvn-version: Version of maven to use. (default: mvn35)
     :stream: Keyword that can be used to represent a release code-name.
         Often the same as the branch. (default: master)
     :submodule-recursive: Whether to checkout submodules recursively.