Skip to content

Name the SNAPSHOT target in CI, not in the POM - #11

Merged
oranheim merged 2 commits into
masterfrom
ci/snapshot-target-in-ci
Nov 23, 2026
Merged

oranheim merged 2 commits into
masterfrom
ci/snapshot-target-in-ci

Conversation

@oranheim

Copy link
Copy Markdown
Member

The descoped-snapshots profile leaves the POM. A settings.xml profile can't replace it: settings profiles hold only properties, repositories and activation, not a deployment target or plugins. CI's deploy step names everything on its command line instead.

ci.yml (Deploy step only)

  • settings.xml keeps only the descoped-snapshots server: the token and repositoryOrigins. The profile that set descoped.snapshots.url is gone.
  • The command is -DaltSnapshotDeploymentRepository="descoped-snapshots::$url" -DdeployAtEnd=true -DskipTests -DskipITs source:jar-no-fork deploy. $url comes from the endpoint lookup and stays masked.

pom.xml: the profile is removed. The central profile keeps requireReleaseVersion and requireReleaseDeps, and its comments now say CI publishes SNAPSHOTs.

.claude/CLAUDE.md: the Publishing rule says the job names the target on its command line.

Why the profile's guards are not needed

  • The alternative repository applies to SNAPSHOT versions only, and the POM has no other deployment target. Tested locally against a file repository: a release version fails with "repository element was not specified".
  • The job's "Only a SNAPSHOT" step still checks before any credentials exist.
  • With no property, there is nothing for requireProperty to check. If the endpoint lookup fails, the step stops (bash -e).

Checked

  • Locally on JDK 17: verify javadoc:javadoc passes, and -P central still refuses a SNAPSHOT.
  • Test publish by workflow_dispatch (run 45201739023): build and "Publish SNAPSHOTs" succeeded.
    • 0.1.1-ci-snapshot-target-in-ci-SNAPSHOT: metadata, pom, jar and sources jar read back with 200 from maven.descoped.io.
    • The job log has no 12-digit number and no CodeArtifact host.
    • The deployed pom has no account ID, no endpoint and no snapshotRepository.

This is the CI-only variant of the Descoped SNAPSHOT standard (dossier d216929, reverted in 377b94c). java-tuple now differs from the standard and from rawdata-client-project until those follow.

The descoped-snapshots profile is removed. CI's deploy step names the target
on its command line (-DaltSnapshotDeploymentRepository), adds the sources
(source:jar-no-fork) and -DdeployAtEnd=true, and its settings.xml keeps only the
server with the token and repositoryOrigins.

The alternative repository applies to SNAPSHOTs only and the POM has no other
deployment target, so a release version fails to deploy rather than reaching
CodeArtifact. The job's "Only a SNAPSHOT" step still checks first. The central
profile keeps requireReleaseVersion and requireReleaseDeps.
@claude

claude Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Claude finished @oranheim's task in 42s —— View job


Review of PR #11: Name the SNAPSHOT target in CI, not in the POM

  • Read .claude/CLAUDE.md
  • Review diff (ci.yml, pom.xml, CLAUDE.md)
  • Post review

Verdict: clean. No CRITICAL issues. The change removes POM configuration and does what the description says. No Java, README or test changes are involved, so the Java 17, JPMS, wire-compatibility, immutability, malformed-input and Javadoc invariants don't apply here.

What I checked

  • ci.yml:170-172: -DaltSnapshotDeploymentRepository="descoped-snapshots::$url" uses the id::url form that maven-deploy-plugin 3.x expects (pom.xml:312, 3.2.0). The id matches the <server> in the generated settings.xml (ci.yml:159), so the token and repositoryOrigins still apply under credentialScope=strict.
  • The URL is still kept out of public files. $url is masked at ci.yml:151 before it is used. The heredoc is still quoted (<<'XML'), so the shell does not expand anything in it and Maven reads only ${env.*}. With SNAPSHOTS_URL gone, the endpoint is no longer an environment variable that Maven or a plugin could leak into the deployed POM.
  • The guards the profile used to provide are still covered:
    • requireSnapshotVersion: the "Only a SNAPSHOT" step (ci.yml:113-119) runs before any credentials exist. Without a <distributionManagement>, a release deploy also fails on its own.
    • requireProperty: nothing is left for it to check. If the endpoint lookup fails, the step stops at url=$(…), because GitHub's default bash -e shell applies.
    • deployAtEnd: still set, now as -DdeployAtEnd=true.
    • Source jar: still produced, by source:jar-no-fork on the command line. Its version comes from pluginManagement (pom.xml:246, 3.4.0), so it is still pinned.
  • pom.xml: no stale descoped-snapshots profile references are left. The central profile keeps requireReleaseVersion and requireReleaseDeps, and its comments and messages are updated. The descoped-snapshots-public read repository (pom.xml:53-56) and its "never the id descoped-snapshots here" warning are untouched and still correct.
  • Old configuration is removed, not carried along, as the "latest stable / remove old config" invariant asks.
  • No secrets or hardcoded values were added. No account ID, no endpoint, and the role ARN is still a secret.
  • .claude/CLAUDE.md:59-65 now matches the workflow.

SUGGESTION (non-blocking)

  1. The release-version guard is now implicit. It holds only because the POM has no <distributionManagement> (the PR's local test confirms the "repository element was not specified" failure). If someone later adds a <repository> to distributionManagement, a release run of the snapshot job would be stopped only by the "Only a SNAPSHOT" step. That is still a real guard, so this is fine. You could make the dependency explicit by adding to the CLAUDE.md Publishing rule that the POM has no distributionManagement at all.
  2. The review instructions disagree with CLAUDE.md. The instructions I was given for this review say "CI publishes nothing (no SNAPSHOTs…)". .claude/CLAUDE.md says SNAPSHOTs go from CI's snapshot job and only releases are forbidden. I reviewed against CLAUDE.md as written, and the PR complies with it. You may want to update the review prompt so the two match.

I didn't run the build or tests here. CI runs them on JDK 17. The PR description reports local verify javadoc:javadoc and a successful test publish (run 45201739023).

- .claude/CLAUDE.md: the POM has no distributionManagement at all, and that is
  what stops a release version from deploying to maven.descoped.io; never add one.
- claude.yml: the review prompt's publishing rule now matches CLAUDE.md, in
  place of the old "CI publishes nothing".
@oranheim

Copy link
Copy Markdown
Member Author

Review findings addressed

The review was clean (no CRITICAL findings). Both suggestions are fixed in c737770:

# Suggestion Fix
1 The release-version guard is implicit: it relies on the POM having no distributionManagement .claude/CLAUDE.md (Publishing) now says the POM has no distributionManagement at all, that this is what makes a release version fail to deploy to maven.descoped.io, and never to add one. The job's "Only a SNAPSHOT" step remains the first check.
2 The review prompt says "CI publishes nothing (no SNAPSHOTs…)", which disagrees with CLAUDE.md claude.yml's prompt now states the rule as CLAUDE.md does: releases only to Maven Central from the owner's machine, never from CI; SNAPSHOTs only to maven.descoped.io from the CI snapshot job, which names the target on its command line; no distributionManagement in the POM; no account ID or endpoint in any public file.

@oranheim
oranheim merged commit 623efa7 into master Nov 23, 2026
2 checks passed
@oranheim
oranheim deleted the ci/snapshot-target-in-ci branch November 23, 2026 17:44
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