Fix API breakage caused by OS Plugin version scan
[releng/global-jjb.git] / shell / maven-javadoc-generate.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
5 #
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
12 # Generates javadoc in a Maven project.
13
14 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
15 # Ensure we fail the job if any steps fail.
16 set -xe -o pipefail
17 set +u
18
19 JAVADOC_DIR="$WORKSPACE/archives/javadoc"
20 mkdir -p "$WORKSPACE/archives"
21
22 export MAVEN_OPTS
23
24 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
25 # shellcheck disable=SC2086
26 $MVN clean install javadoc:aggregate \
27     -e -Pq -Dmaven.javadoc.skip=false \
28     -DskipTests=true \
29     -Dcheckstyle.skip=true \
30     -Dfindbugs.skip=true \
31     --global-settings "$GLOBAL_SETTINGS_FILE" \
32     --settings "$SETTINGS_FILE" \
33     $MAVEN_OPTIONS $MAVEN_PARAMS
34
35 mv "$WORKSPACE/target/site/apidocs" "$JAVADOC_DIR"