Skip to content

Prevent example modules from being published to Maven Central#1127

Merged
bdemers merged 1 commit into
apache:developfrom
bdemers:keep-examples-off-maven-central
May 31, 2026
Merged

Prevent example modules from being published to Maven Central#1127
bdemers merged 1 commit into
apache:developfrom
bdemers:keep-examples-off-maven-central

Conversation

@bdemers
Copy link
Copy Markdown
Member

@bdemers bdemers commented May 31, 2026

What

Introduce an intermediate parent POM at scim-server-examples/pom.xml (groupId org.apache.directory.scimple.examples, packaging=pom) that makes the example modules non-publishing, and reparent the six examples under it.

Why

The scim-server-examples/* demos are intentionally not production-hardened (cleartext passwords, no auth/TLS). They are documented as out of scope and "not published to Maven Central", but nothing in the build actually enforced that — a full reactor deploy would have staged them. This makes that guarantee structural rather than aspirational.

How

  • New scim-server-examples/pom.xml sets maven.deploy.skip and skipNexusStagingDeployMojo once, plus an apache-release profile that skips the source, gpg, and javadoc plugins for the examples.
  • The six example modules inherit from it, so future example modules are non-publishing by default.
  • The root reactor now lists the single scim-server-examples aggregator instead of the six individual modules.
  • scim-coverage is deliberately left untouched. It is the last reactor module, which is where nexus-staging-maven-plugin triggers the deferred batch upload — skipping it would suppress publishing of the real libraries. A comment marks it as required-last.

The set of published modules (scim-spec-schema, scim-spec-protocol, scim-client, scim-core, scim-server, scim-spring-boot-starter, and the test-support artifacts) is unchanged.

Verification

Local, -Pci:

  • ./mvnw -Pci -DskipTests verify — BUILD SUCCESS across all modules (RAT + SpotBugs clean).
  • During a full-reactor deploy, each of the six examples logs Skipping Nexus Staging Deploy Mojo at user's demand., while scim-core and scim-server perform deferred deploys — confirming the skip does not leak to the published libraries.

Note: a local file-repo deploy cannot exercise the real Nexus staging path (nexus-staging with extensions=true ignores -DaltDeploymentRepository and contacts repository.apache.org at reactor close). A maintainer with ASF staging credentials should confirm a real staging run shows the examples absent and the libraries present before the next release.

The scim-server-examples/* demos are intentionally not production-hardened
(cleartext passwords, no auth/TLS) and must never appear as consumable
artifacts. Previously nothing in the build prevented a full reactor deploy
from staging them.

Introduce an intermediate parent POM at scim-server-examples/pom.xml
(groupId org.apache.directory.scimple.examples, packaging pom) that sets
maven.deploy.skip and skipNexusStagingDeployMojo once, plus pluginManagement
overrides that skip the source, gpg, and javadoc plugins for the examples. The
six example modules inherit from it, so future examples are non-publishing by
default. The root reactor now references the single scim-server-examples
aggregator.

The skip behavior lives in pluginManagement rather than build/plugins and an
apache-release profile: the plugins are already bound elsewhere (nexus-staging
in the root reactor's build, source/gpg/javadoc by the ASF apache-release
profile), so management-only config overrides them uniformly across every
example module without forcing new plugin bindings.

scim-coverage is deliberately left untouched: it is the last reactor module
and is where nexus-staging triggers the deferred batch upload, so skipping it
would suppress publishing of the real libraries. A comment marks it as
required-last.
@bdemers bdemers force-pushed the keep-examples-off-maven-central branch from 5af57d8 to 1d4121e Compare May 31, 2026 17:43
@bdemers bdemers merged commit 1dc926d into apache:develop May 31, 2026
6 checks passed
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.

1 participant