Lift the assumption that all files are in the git repository root.
Extend maven-javadoc publish and javadoc-verify macros with mvn-dir
configuration parameter (like tox-dir), defaults to '.' to preserve
existing behavior.
Extend maven-javadoc-generate.sh script to invoke mvn with the -f
option and use the directory name when archiving the generated HTML;
drop -x setting to conform with other scripts.
Document the new configuration parameter.
Projects using macros lf-maven-javadoc-publish, lf-maven-javadoc-verify
(i.e., using job templates gerrit-maven-javadoc-publish,
github-maven-javadoc-publish, gerrit-maven-javadoc-verify or
github-maven-javadoc-verify) must ensure the maven -f option is not
used in config parameter mvn-params.
Change-Id: Ib02a12a3192b8be577a0367476628c46db333231
Issue-ID: RELENG-1872
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
Maven configuration. (default: global-settings)
:mvn-goals: The maven goals to perform for the build.
(default: clean install)
Maven configuration. (default: global-settings)
:mvn-goals: The maven goals to perform for the build.
(default: clean install)
- :mvn-opts: Sets MAVEN_OPTS. (default: '')
+ :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:nexus-iq-namespace: Insert a namespace to project AppID for projects that
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:nexus-iq-namespace: Insert a namespace to project AppID for projects that
Produces and publishes javadocs for a Maven project.
Produces and publishes javadocs for a Maven project.
-Expects javadocs to be available in $WORKSPACE/target/site/apidocs
+Expects javadocs to be available in $WORKSPACE/target/site/apidocs, unless
+the mvn-dir parameter is supplied, in which case expects javadocs to be
+available in $WORKSPACE/{mvn-dir}/target/site/apidocs.
: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)
: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-dir: Directory supplied as argument to -f option (default: '.')
:mvn-global-settings: The name of the Maven global settings to use for
Maven configuration. (default: global-settings)
: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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
+ Must not include a "-f" option; see parameter mvn-dir.
: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)
: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)
Produces javadocs for a Maven project.
Produces javadocs for a Maven project.
-Expects javadocs to be available in $WORKSPACE/target/site/apidocs
+Expects javadocs to be available in $WORKSPACE/target/site/apidocs, unless
+the mvn-dir parameter is supplied, in which case expects javadocs to be
+available in $WORKSPACE/{mvn-dir}/target/site/apidocs.
: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)
: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)
+ :mvn-dir: Directory supplied as argument to -f option (default: '.')
:mvn-global-settings: The name of the Maven global settings to use for
Maven configuration. (default: global-settings)
: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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
+ Must not include a "-f" option; see parameter mvn-dir.
: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)
: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)
: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)
: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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (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`.
: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`.
:maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
:mvn-global-settings: The name of the Maven global settings to use for
Maven configuration. (default: global-settings)
:maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false)
: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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:ossrh-profile-id: Profile ID for project as provided by OSSRH.
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:ossrh-profile-id: Profile ID for project as provided by OSSRH.
Maven configuration. (default: global-settings)
:mvn-goals: The maven goals to perform for the build.
(default: clean install)
Maven configuration. (default: global-settings)
:mvn-goals: The maven goals to perform for the build.
(default: clean install)
- :mvn-opts: Sets MAVEN_OPTS. (default: '')
+ :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:sonar-mvn-goals: Maven goals to run for sonar analysis.
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:sonar-mvn-goals: Maven goals to run for sonar analysis.
: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)
: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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:stream: Keyword that can be used to represent a release code-name.
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:stream: Keyword that can be used to represent a release code-name.
: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)
: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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:stream: Keyword that can be used to represent a release code-name.
:mvn-params: Additional mvn parameters to pass to the cli. (default: '')
:mvn-version: Version of maven to use. (default: mvn35)
:stream: Keyword that can be used to represent a release code-name.
git-url: "$GIT_URL/$PROJECT"
github-url: "https://github.com"
java-version: openjdk8
git-url: "$GIT_URL/$PROJECT"
github-url: "https://github.com"
java-version: openjdk8
mvn-global-settings: global-settings
mvn-opts: ""
mvn-params: ""
mvn-global-settings: global-settings
mvn-opts: ""
mvn-params: ""
- lf-infra-create-netrc:
server-id: "{mvn-site-id}"
- inject:
- lf-infra-create-netrc:
server-id: "{mvn-site-id}"
- inject:
- properties-content: "DEPLOY_PATH={javadoc-path}"
+ properties-content: |
+ DEPLOY_PATH={javadoc-path}
+ MAVEN_DIR={mvn-dir}
- shell: !include-raw-escape:
- ../shell/common-variables.sh
- ../shell/maven-javadoc-generate.sh
- shell: !include-raw-escape:
- ../shell/common-variables.sh
- ../shell/maven-javadoc-generate.sh
git-url: "$GIT_URL/$PROJECT"
github-url: "https://github.com"
java-version: openjdk8
git-url: "$GIT_URL/$PROJECT"
github-url: "https://github.com"
java-version: openjdk8
mvn-global-settings: global-settings
mvn-opts: ""
mvn-params: ""
mvn-global-settings: global-settings
mvn-opts: ""
mvn-params: ""
- lf-provide-maven-settings:
global-settings-file: "{mvn-global-settings}"
settings-file: "{mvn-settings}"
- lf-provide-maven-settings:
global-settings-file: "{mvn-global-settings}"
settings-file: "{mvn-settings}"
+ - inject:
+ properties-content: |
+ MAVEN_DIR={mvn-dir}
- shell: !include-raw-escape:
- ../shell/common-variables.sh
- ../shell/maven-javadoc-generate.sh
- shell: !include-raw-escape:
- ../shell/common-variables.sh
- ../shell/maven-javadoc-generate.sh
--- /dev/null
+---
+upgrade:
+ - |
+ Projects using macros lf-maven-javadoc-publish or lf-maven-javadoc-verify
+ (i.e., using job templates gerrit-maven-javadoc-publish, github-maven-javadoc-publish,
+ gerrit-maven-javadoc-verify or github-maven-javadoc-verify) must ensure the
+ maven -f option is not used in config parameter mvn-params.
+features:
+ - |
+ Generate javadoc from a project in a subdirectory, which lifts the
+ assumption that all files are in the git repository root.
+ Extend maven-javadoc publish and javadoc-verify templates with mvn-dir
+ configuration parameter (like tox-dir), defaults to '.' to keep existing
+ behavior.
+ Extend maven-javadoc-generate.sh script to invoke mvn with the -f option
+ and use the directory name when archiving the generated HTML.
+ Document the new configuration parameter.
echo "---> maven-javadoc-generate.sh"
# Generates javadoc in a Maven project.
echo "---> maven-javadoc-generate.sh"
# Generates javadoc in a Maven project.
-# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
# Ensure we fail the job if any steps fail.
# Ensure we fail the job if any steps fail.
+# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
+set -e -o pipefail
set +u
JAVADOC_DIR="$WORKSPACE/archives/javadoc"
set +u
JAVADOC_DIR="$WORKSPACE/archives/javadoc"
-Dfindbugs.skip=true \
--global-settings "$GLOBAL_SETTINGS_FILE" \
--settings "$SETTINGS_FILE" \
-Dfindbugs.skip=true \
--global-settings "$GLOBAL_SETTINGS_FILE" \
--settings "$SETTINGS_FILE" \
$MAVEN_OPTIONS $MAVEN_PARAMS
$MAVEN_OPTIONS $MAVEN_PARAMS
-mv "$WORKSPACE/target/site/apidocs" "$JAVADOC_DIR"
+mv "$WORKSPACE/$MAVEN_DIR/target/site/apidocs" "$JAVADOC_DIR"
# TODO: Nexus unpack plugin throws a "504 gateway timeout" for jobs archiving
# large number of small files. Remove the workaround only we move away from
# TODO: Nexus unpack plugin throws a "504 gateway timeout" for jobs archiving
# large number of small files. Remove the workaround only we move away from