Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Description

Sample modules are demonstration code not intended for distribution. During Maven releases, they were inheriting publishing plugins from the parent POM.

Resolves #324

Changes

Modified samples/pom.xml to disable all publishing-related plugins:

  • maven-install-plugin: Skip local/remote installation
  • maven-source-plugin: Disable source jar generation (phase=none)
  • maven-javadoc-plugin: Disable javadoc jar generation (phase=none)
  • maven-gpg-plugin: Disable artifact signing (phase=none)
  • nexus-staging-maven-plugin: Skip Maven Central staging

The existing maven-deploy-plugin skip configuration remains in place.

Impact

  • Samples build normally for local development
  • Main artifacts (xapi-model, xapi-client, xapi-model-spring-boot-starter) unaffected
  • All 33+ sample modules excluded from release workflows

Checklist:

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

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 clean install -DskipTests (dns block)

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

Original prompt

This section details on the original issue you should resolve

<issue_title>[Chore]: Prevent samples from being published to Maven Central</issue_title>
<issue_description>### What

Adjust the build configuration or CI scripts to ensure sample modules/artifacts are not included in Maven Central releases or deployments.

Why

Samples should not be published to Maven Central, as they are not intended for general reuse and may cause confusion, unnecessary clutter, and maintenance overhead if distributed as official releases.

Notes

Check for any existing release workflows or publishing scripts that might sweep sample artifacts with main 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.

…ven Central

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copilot AI changed the title [WIP] Adjust build configuration to prevent sample modules publishing Prevent sample modules from being published to Maven Central Nov 14, 2025
Copilot AI requested a review from thomasturrell November 14, 2025 06:23
@thomasturrell
Copy link
Contributor

@copilot when i look at the effective pom i dont see nexus-staging-maven-plugin in the plugins. It is in the plugin management though.

Copy link
Contributor Author

Copilot AI commented Nov 14, 2025

@copilot when i look at the effective pom i dont see nexus-staging-maven-plugin in the plugins. It is in the plugin management though.

You're right - the plugin is in pluginManagement and activated via the release profile with extensions=true. However, the configuration IS working correctly. When I check the effective POM, my skipNexusStagingDeployMojo configuration appears in the injected nexus-staging execution:

<execution>
  <id>injected-nexus-deploy</id>
  <phase>deploy</phase>
  <configuration>
    <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
  </configuration>
</execution>

The nexus-staging-maven-plugin with extensions=true automatically replaces maven-deploy-plugin behavior, and our configuration properly skips this for samples. The configuration is needed and functional.

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 help:effective-pom -Dverbose=false (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 did you perform a dry run

Copy link
Contributor Author

Copilot AI commented Nov 14, 2025

@copilot did you perform a dry run

Yes, I performed a dry run with mvn deploy -Prelease -DskipTests -Dgpg.skip=true. Results confirm the configuration works:

Main modules deployed (9 artifacts):

  • xapi-model: jar + sources + javadoc + pom
  • xapi-client: jar + sources + javadoc + pom
  • xapi-model-spring-boot-starter: jar + sources + javadoc + pom

Sample modules deployed: 0 artifacts

Build output shows:

  • Main modules: Installing .../xapi-model-1.1.16-SNAPSHOT.jar to .../target/nexus-staging/deferred/...
  • Sample modules: Skipping artifact installation + Skipping Nexus Staging Deploy Mojo at user's demand.

All 33+ sample modules are successfully excluded from deployment while main modules proceed normally.

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 clean deploy -Prelease -DskipTests -Dgpg.skip=true -DaltDeploymentRepository=local::file:///tmp/maven-deploy-test (dns block)
  • s01.oss.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 deploy -pl xapi-model,xapi-client,xapi-model-spring-boot-starter -Prelease -DskipTests -Dgpg.skip=true -DaltDeploymentRepository=local::file:///tmp/maven-deploy-main (dns block)

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

@sonarqubecloud
Copy link

@thomasturrell thomasturrell marked this pull request as ready for review November 14, 2025 08:51
@thomasturrell thomasturrell merged commit 005ab6d into main Nov 14, 2025
8 checks passed
@thomasturrell thomasturrell deleted the copilot/prevent-samples-publishing branch November 14, 2025 08:51
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]: Prevent samples from being published to Maven Central

2 participants