Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Description

The maven-publish-snapshot workflow fails when running mvn javadoc:javadoc because Maven attempts to generate javadoc for sample modules whose artifacts are never installed to the local repository, causing dependency resolution failures.

Resolves #330

Changes

.github/workflows/maven-publish-snapshot.yml

  • Restrict javadoc generation to deployed modules only: xapi-model, xapi-client, xapi-model-spring-boot-starter
  • Prevents Maven from processing sample modules that reference uninstalled artifacts
  • Fixed typo in comment ("vaild" → "valid")

samples/pom.xml

  • Add <skip>true</skip> to maven-javadoc-plugin configuration
  • Ensures samples are excluded from javadoc generation at plugin level

Why the -pl switch is necessary

While the <skip>true</skip> configuration prevents javadoc generation for samples, Maven still processes all reactor modules and attempts to resolve their dependencies before executing plugins. Since sample modules depend on each other (e.g., get-statement → core) and have their install phase skipped, their artifacts aren't available in the local repository, causing dependency resolution failures. The -pl switch prevents Maven from processing sample modules entirely.

Checklist:

  • Public methods are documented
  • Public methods are tested
  • New and existing tests pass when run locally
  • There are no new warnings or errors
Original prompt

This section details on the original issue you should resolve

<issue_title>[Chore]: Fix deploy goal documentation publishing failures</issue_title>
<issue_description>### What

The Maven deploy goal (mvn deploy --file pom.xml) fails due to issues with documentation generation, specifically problems encountered when generating or publishing Javadoc or related docs. This prevents successful deployment of artifacts. Problems may stem from plugin misconfiguration, profile inclusion, or unintended publishing attempts from sample modules.

Why

This chore is necessary to ensure that documentation build errors do not block deployment. Addressing this will allow successful publication of project artifacts and avoid failed CI/CD deploys due to documentation issues.

Notes

  • Documentation (e.g., Javadoc) fails during the deploy step, blocking artifact publication.
  • Common causes include plugin misconfiguration or samples/test modules being published.
  • Review the Maven plugin setup to ensure only intended modules generate or publish documentation during deploy.
  • The repository configuration should explicitly skip documentation publish steps for sample/non-core modules.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix deploy goal documentation publishing failures Fix javadoc generation blocking snapshot deployment Nov 14, 2025
Copilot AI requested a review from thomasturrell November 14, 2025 23:35
Copy link
Contributor Author

Copilot AI commented Nov 14, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repository.sonatype.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/work/xapi-java/xapi-java/.mvn/wrapper/maven-wrapper.jar -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/xapi-java/xapi-java org.apache.maven.wrapper.MavenWrapperMain -B javadoc:javadoc --file pom.xml (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@thomasturrell
Copy link
Contributor

@copilot i suspect you will need to make similar changes for the non snapshot release which is in one of the other workflows.

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 15, 2025

@copilot i suspect you will need to make similar changes for the non snapshot release which is in one of the other workflows.

Added a javadoc validation step to maven-publish.yml with the same -pl flag to ensure consistency and catch any javadoc issues before the release is published. Commit: cb777d8

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repository.sonatype.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/work/xapi-java/xapi-java/.mvn/wrapper/maven-wrapper.jar -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/xapi-java/xapi-java org.apache.maven.wrapper.MavenWrapperMain -B release:prepare -DdryRun=true -Prelease -DskipTests -Dgpg.skip=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Fix javadoc generation blocking snapshot deployment Fix javadoc generation blocking deployment workflows Nov 15, 2025
@sonarqubecloud
Copy link

@thomasturrell thomasturrell marked this pull request as ready for review November 15, 2025 09:24
@thomasturrell
Copy link
Contributor

@copilot please update the pr title and description to match the changes in the code.

Copy link
Contributor Author

Copilot AI commented Nov 15, 2025

@copilot please update the pr title and description to match the changes in the code.

Updated understanding: The PR actually only fixes the maven-publish-snapshot workflow since the javadoc validation step added to maven-publish.yml was removed in commits 0edd9e7 and af7f86d.

Suggested PR title: "Fix javadoc generation blocking snapshot deployment"

Suggested PR description updates:

  • Change "Both maven-publish-snapshot and maven-publish workflows fail" to "The maven-publish-snapshot workflow fails"
  • Remove the section about maven-publish.yml changes
  • Keep the sections about maven-publish-snapshot.yml and samples/pom.xml

The actual changes in this PR are:

  1. .github/workflows/maven-publish-snapshot.yml - Added -pl xapi-model,xapi-client,xapi-model-spring-boot-starter flag and fixed typo
  2. samples/pom.xml - Added <skip>true</skip> to maven-javadoc-plugin configuration

Note: I cannot directly update the PR title and description through the tools available to me, so you'll need to update them manually or let me know if you'd like me to make any code changes.

Copilot AI changed the title Fix javadoc generation blocking deployment workflows Fix javadoc generation blocking snapshot deployment Nov 15, 2025
Copilot AI requested a review from thomasturrell November 15, 2025 09:34
@thomasturrell thomasturrell merged commit 3b4d3f8 into main Nov 15, 2025
5 checks passed
@thomasturrell thomasturrell deleted the copilot/fix-deploy-goal-documentation branch November 15, 2025 09:38
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.

[Chore]: Fix deploy goal documentation publishing failures

2 participants