-
Notifications
You must be signed in to change notification settings - Fork 74
MLE-27841 Generating javadocs on each publish #1927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -198,6 +198,22 @@ pipeline { | |||||||||||||
| ./gradlew publish | ||||||||||||||
| ''' | ||||||||||||||
| } | ||||||||||||||
| post { | ||||||||||||||
| always { | ||||||||||||||
| sh label: 'generate-javadoc', script: '''#!/bin/bash | ||||||||||||||
| export JAVA_HOME=$JAVA_HOME_DIR | ||||||||||||||
| export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR | ||||||||||||||
| export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH | ||||||||||||||
| cd java-client-api | ||||||||||||||
| ./gradlew javadoc | ||||||||||||||
| echo "Zipping javadocs for easy download..." | ||||||||||||||
| cd marklogic-client-api/build/docs | ||||||||||||||
| zip -r javadoc.zip javadoc/ | ||||||||||||||
|
||||||||||||||
| zip -r javadoc.zip javadoc/ | |
| "$JAVA_HOME/bin/jar" cf javadoc.zip javadoc |
Copilot
AI
Mar 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
archiveArtifacts artifacts: 'javadoc.zip' will fail the build if the zip isn't produced (e.g., javadoc task fails or zip isn't available). To avoid an unintended publish failure, guard this with a fileExists('javadoc.zip') check and/or set allowEmptyArchive: true.
| archiveArtifacts artifacts: 'javadoc.zip', fingerprint: true | |
| script { | |
| if (fileExists('javadoc.zip')) { | |
| archiveArtifacts artifacts: 'javadoc.zip', fingerprint: true | |
| } | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post { always { ... } }will run even when./gradlew publishfails, and any failure in the javadoc/zip step will also fail the stage/build. If the intent is to publish docs only when publishing succeeds (and to avoid breaking publishing due to doc generation issues), consider usingpost { success { ... } }or make the doc generation non-blocking with explicit error handling.