Revise javadoc script dash-f argument 14/62814/7
authorLott, Christopher (cl778h) <cl778h@att.com>
Wed, 15 Jan 2020 20:17:03 +0000 (15:17 -0500)
committerLott, Christopher (cl778h) <cl778h@att.com>
Thu, 16 Jan 2020 01:35:51 +0000 (20:35 -0500)
Revise shell script maven-javadoc-generate.sh to supply -f
argument to maven with absolute path determined by readlink.
This works around javadoc:aggregate behavior of silently
generating no files in parent project if invoked as "-f ."

Change-Id: I6856756539dd8aee80d8841dfbfe9efb76b8cb93
Issue-Id: RELENG-2672
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
releasenotes/notes/maven-javadoc-dash-f-87c652e0363b3c6d.yaml [new file with mode: 0644]
shell/maven-javadoc-generate.sh

diff --git a/releasenotes/notes/maven-javadoc-dash-f-87c652e0363b3c6d.yaml b/releasenotes/notes/maven-javadoc-dash-f-87c652e0363b3c6d.yaml
new file mode 100644 (file)
index 0000000..bb3e5ce
--- /dev/null
@@ -0,0 +1,7 @@
+---
+fixes:
+  - |
+    Revise shell script maven-javadoc-generate.sh to supply -f
+    argument to maven with argument translated by call to readlink.
+    This works around the javadoc:aggregate behavior of silently
+    doing nothing if invoked "-f ."
index 137f4d7..0f1cac3 100644 (file)
@@ -21,19 +21,23 @@ mkdir -p "$WORKSPACE/archives"
 
 export MAVEN_OPTS
 
+# use absolute path as workaround for javadoc:aggregate
+# silent failure on relative path, for example "-f ."
+maven_dir_abs=$(readlink -f $MAVEN_DIR)
+
 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
 # shellcheck disable=SC2086
 # Use -x via subshell to show maven invocation details in the log
 (set -x
   $MVN clean install javadoc:aggregate \
+    -f "$maven_dir_abs" \
     -e -Pq -Dmaven.javadoc.skip=false \
     -DskipTests=true \
     -Dcheckstyle.skip=true \
     -Dfindbugs.skip=true \
     --global-settings "$GLOBAL_SETTINGS_FILE" \
     --settings "$SETTINGS_FILE" \
-    -f "$MAVEN_DIR" \
-    $MAVEN_OPTIONS $MAVEN_PARAMS \
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 )
 
 mv "$WORKSPACE/$MAVEN_DIR/target/site/apidocs" "$JAVADOC_DIR"