Skip to content

Commit fe75777

Browse files
committed
docs: make current javadoc build deterministic
The docs Javadoc script first installs reactor artifacts, then runs the explicit Maven Javadoc goal and copies the generated core API docs. Running the install phase with Maven parallelism can race module-local annotation processor resolution: examples may try to resolve the current java-driver-mapper-processor snapshot before that module has been installed into the local Maven repository. Run the preliminary install serially so the docs Javadoc target is reproducible from a clean local repository or CI worker. Also accept the current maven-javadoc-plugin output location, core/target/reports/apidocs, while keeping the previous core/target/site/apidocs path as a fallback. The explicit Javadoc goal passes but writes to reports/apidocs with the current plugin, so copying only site/apidocs makes the docs target fail after successful Javadoc generation.
1 parent 91b0937 commit fe75777

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

docs/_utils/javadoc.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euo pipefail
33

44
# Install dependencies
5-
mvn install -DskipTests -Dmaven.javadoc.skip=true -T 1C
5+
mvn install -DskipTests -Dmaven.javadoc.skip=true
66

77
# Define output folder
88
OUTPUT_DIR="docs/_build/dirhtml/api"
@@ -13,8 +13,16 @@ fi
1313

1414
# Generate javadoc
1515
mvn javadoc:javadoc -T 1C
16+
JAVADOC_SOURCE_DIR="core/target/site/apidocs"
17+
if [[ ! -d "$JAVADOC_SOURCE_DIR" && -d "core/target/reports/apidocs" ]]; then
18+
JAVADOC_SOURCE_DIR="core/target/reports/apidocs"
19+
fi
20+
if [[ ! -d "$JAVADOC_SOURCE_DIR" ]]; then
21+
echo "Javadoc output directory was not generated" >&2
22+
exit 1
23+
fi
1624
if [[ -d "$OUTPUT_DIR" ]]; then
1725
rm -r "$OUTPUT_DIR"
1826
fi
1927
mkdir -p "$OUTPUT_DIR"
20-
mv -f core/target/site/apidocs/* "$OUTPUT_DIR"
28+
mv -f "$JAVADOC_SOURCE_DIR"/* "$OUTPUT_DIR"

0 commit comments

Comments
 (0)