2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> maven-javadoc-generate.sh"
12 # Generates javadoc in a Maven project.
14 # Ensure we fail the job if any steps fail.
15 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
19 JAVADOC_DIR="$WORKSPACE/archives/javadoc"
20 mkdir -p "$WORKSPACE/archives"
24 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
25 # shellcheck disable=SC2086
26 # Use -x via subshell to show maven invocation details in the log
28 $MVN clean install javadoc:aggregate \
29 -e -Pq -Dmaven.javadoc.skip=false \
31 -Dcheckstyle.skip=true \
32 -Dfindbugs.skip=true \
33 --global-settings "$GLOBAL_SETTINGS_FILE" \
34 --settings "$SETTINGS_FILE" \
36 $MAVEN_OPTIONS $MAVEN_PARAMS \
39 mv "$WORKSPACE/$MAVEN_DIR/target/site/apidocs" "$JAVADOC_DIR"
41 # TODO: Nexus unpack plugin throws a "504 gateway timeout" for jobs archiving
42 # large number of small files. Remove the workaround when we move away from
43 # using Nexus as the log server.
44 if [[ "$JOB_NAME" =~ "javadoc-verify" ]]; then
45 # Tarball the javadoc dir and rm the directory to avoid re-upload into logs
46 tarball="$WORKSPACE/archives/javadoc.tar.xz"
47 echo "INFO: archiving $JAVADOC_DIR as $tarball"