Skip to content

MLE-27841 Generating javadocs on each publish#1927

Merged
rjrudin merged 1 commit intodevelopfrom
feature/javadocs
Mar 23, 2026
Merged

MLE-27841 Generating javadocs on each publish#1927
rjrudin merged 1 commit intodevelopfrom
feature/javadocs

Conversation

@rjrudin
Copy link
Contributor

@rjrudin rjrudin commented Mar 23, 2026

This simplifies life for the docs team by allowing them to download the zip of docs.

This simplifies life for the docs team by allowing them to download the zip of docs.
Copilot AI review requested due to automatic review settings March 23, 2026 13:19
@github-actions
Copy link

Copyright Validation Results
Total: 1 | Passed: 0 | Failed: 0 | Skipped: 1 | at: 2026-03-23 13:20:06 UTC | commit: 30d3bd6

⏭️ Skipped (Excluded) Files

  • Jenkinsfile

✅ All files have valid copyright headers!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Javadoc generation and archiving to the CI publish workflow so the docs team can download a zipped Javadoc artifact from Jenkins.

Changes:

  • Generate Javadocs after the publish stage runs.
  • Zip the generated Javadocs and archive the zip as a Jenkins build artifact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

zip -r javadoc.zip javadoc/
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.
./gradlew javadoc
echo "Zipping javadocs for easy download..."
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.
Comment on lines +201 to +209
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..."
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.
@rjrudin rjrudin merged commit 100d21f into develop Mar 23, 2026
9 checks passed
@rjrudin rjrudin deleted the feature/javadocs branch March 23, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants