+# TODO: Nexus unpack plugin throws a "504 gateway timeout" for jobs archiving
+# large number of small files. Remove the workaround when we move away from
+# using Nexus as the log server.
+if [[ "$JOB_NAME" =~ "javadoc-verify" ]]; then
+ # Tarball the javadoc dir and rm the directory to avoid re-upload into logs
+ tarball="$WORKSPACE/archives/javadoc.tar.xz"
+ echo "INFO: archiving $JAVADOC_DIR as $tarball"
+ pushd "$JAVADOC_DIR"
+ tar cvJf "$tarball" .
+ popd
+ rm -rf "$JAVADOC_DIR"
+fi