Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Comment on lines +201 to +209
Copy link

Copilot AI Mar 23, 2026

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 publish fails, 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 using post { success { ... } } or make the doc generation non-blocking with explicit error handling.

Copilot uses AI. Check for mistakes.
cd marklogic-client-api/build/docs
zip -r javadoc.zip javadoc/
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step assumes the Jenkins agent has the zip CLI installed. If that's not guaranteed on javaClientLinuxPool, consider using a more universally available archiver (e.g., tar) or the JDK jar tool, or ensure zip is provisioned on the agent.

Suggested change
zip -r javadoc.zip javadoc/
"$JAVA_HOME/bin/jar" cf javadoc.zip javadoc

Copilot uses AI. Check for mistakes.
mv javadoc.zip $WORKSPACE/
'''
archiveArtifacts artifacts: 'javadoc.zip', fingerprint: true
Copy link

Copilot AI Mar 23, 2026

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.

Suggested change
archiveArtifacts artifacts: 'javadoc.zip', fingerprint: true
script {
if (fileExists('javadoc.zip')) {
archiveArtifacts artifacts: 'javadoc.zip', fingerprint: true
}
}

Copilot uses AI. Check for mistakes.
}
}
}

stage('regressions') {
Expand Down
Loading