Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 15, 2025

Description

Resolves #337

Maven release was processing all modules including 30+ samples despite skip configurations in samples/pom.xml. Skip flags prevent deployment but don't exclude modules from the reactor, causing release failures.

Changes

Root cause: Maven's -pl with negation (!samples) fails to exclude nested submodules defined in the samples parent POM.

Solution: Explicitly list production modules in reactor selection.

  • pom.xml: Added <arguments>-pl xapi-model,xapi-client,xapi-model-spring-boot-starter</arguments> to maven-release-plugin configuration
  • maven-publish-snapshot.yml: Applied same module selection to snapshot deploys for consistency

Now only the three production artifacts are built, signed, and published during releases. Sample modules remain buildable locally but are excluded from the release reactor 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]: Exclude all sample modules from Maven release process</issue_title>
<issue_description>### What

Update the Maven release automation to reliably exclude all sample modules from being released.

Several exclusion methods in both workflow and Maven CLI have failed, resulting in sample modules being published. Need a robust solution to prevent this and ensure only intended production modules are released.

Why

This is necessary to prevent sample projects from being included in releases, which pollutes Maven Central and can lead to unintended distribution of example code. A robust solution will help maintain the integrity and professionalism of the published artifacts.

Notes

Previous strategies to exclude sample modules from the Maven release have failed. See #335 for prior attempts and history.

Also see https://github.com/BerryCloud/xapi-java/actions/runs/19395681818 for an example of a failed run.

Consider using -pl with exclusion, modifying Maven workflow configuration, or updating pom files

Looking for guidance or a working example for reliably excluding sample modules. Best practice recommendations and example configs welcome.</issue_description>

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…le selection

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Maven release automation to exclude sample modules Exclude sample modules from Maven release using explicit reactor selection Nov 15, 2025
Copilot AI requested a review from thomasturrell November 15, 2025 23:37
@thomasturrell thomasturrell marked this pull request as ready for review November 15, 2025 23:38
@sonarqubecloud
Copy link

@thomasturrell thomasturrell merged commit f618dd4 into main Nov 15, 2025
5 checks passed
@thomasturrell thomasturrell deleted the copilot/exclude-sample-modules-release branch November 15, 2025 23:42
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]: Exclude all sample modules from Maven release process

2 participants