Skip to content

Prepare release 2.0.0-alpha.1#129

Merged
emmanuel-keller merged 11 commits intomainfrom
emmanuel/prepare-release-2.0.0-alpha-1
Mar 13, 2026
Merged

Prepare release 2.0.0-alpha.1#129
emmanuel-keller merged 11 commits intomainfrom
emmanuel/prepare-release-2.0.0-alpha-1

Conversation

@emmanuel-keller
Copy link
Copy Markdown
Collaborator

No description provided.

@emmanuel-keller emmanuel-keller marked this pull request as ready for review March 13, 2026 19:56
@emmanuel-keller emmanuel-keller merged commit dd18fb5 into main Mar 13, 2026
46 of 49 checks passed
Comment thread build.gradle
Comment on lines +248 to +254
nmcpAggregation {
centralPortal {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
publishingType = "AUTOMATIC"
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 The nmcpAggregation block only configures centralPortal but not centralSnapshots, so the publishAggregationToCentralSnapshots Gradle task called by the CI workflow for SNAPSHOT versions will fail with missing configuration. Either add a centralSnapshots { ... } block to nmcpAggregation or remove the SNAPSHOT branch from the workflow.

Extended reasoning...

What the bug is

The CI workflow (cross.yml, lines 384-392) contains a conditional branch that detects SNAPSHOT versions and calls ./gradlew publishAggregationToCentralSnapshots. However, the nmcpAggregation block in build.gradle (lines 248-254) only configures centralPortal — there is no centralSnapshots configuration block.

How it manifests

The NMCP plugin (com.gradleup.nmcp.aggregation) registers Gradle tasks based on which configuration blocks are present inside nmcpAggregation { ... }. Without a centralSnapshots { ... } block, the publishAggregationToCentralSnapshots task will either not be registered at all (causing a "Task not found" error) or will fail at runtime due to missing repository URL and credentials configuration.

Step-by-step proof

  1. A developer sets the version in build.gradle to something like 2.0.0-SNAPSHOT.
  2. The CI publish job runs and extracts the version: VERSION=2.0.0-SNAPSHOT.
  3. The shell conditional [[ "$VERSION" == *-SNAPSHOT ]] evaluates to true.
  4. The workflow executes ./gradlew publishAggregationToCentralSnapshots.
  5. Gradle looks for the centralSnapshots configuration in nmcpAggregation but finds only centralPortal.
  6. The build fails — either with "Task publishAggregationToCentralSnapshots not found" or with a missing credentials/repository error.

Why existing code does not prevent it

The old publishing configuration explicitly handled both release and snapshot URLs via the removed OSSRH maven repository block, which used version.endsWith('SNAPSHOT') to select between snapshotsRepoUrl and releasesRepoUrl. This PR replaced that with the NMCP plugin but only configured the release portal, not the snapshot repository.

Impact and fix

This is a latent bug — the current version 2.0.0-alpha.1 does not end with -SNAPSHOT, so the broken code path will not trigger for this release. However, the workflow explicitly supports SNAPSHOT publishing (this conditional was added in this PR), and that path is non-functional. The fix is to add a centralSnapshots block inside nmcpAggregation with the appropriate credentials, or remove the SNAPSHOT conditional from the workflow if SNAPSHOT publishing is not needed.

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