Skip to content

fix(release): supply Maven Central creds as ORG_GRADLE_PROJECT_ props (qs-04) - #44

Merged
abbaseya merged 1 commit into
mainfrom
fix/maven-central-cred-env
Jun 4, 2026
Merged

fix(release): supply Maven Central creds as ORG_GRADLE_PROJECT_ props (qs-04)#44
abbaseya merged 1 commit into
mainfrom
fix/maven-central-cred-env

Conversation

@abbaseya

@abbaseya abbaseya commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

After qs-02 (#41) and qs-03 (#43) merged, the Release workflow now runs cleanly through semantic-release into the Gradle Maven Central publish step — where it fails:

> Task :packages:sdk:prepareMavenCentralPublishing FAILED
> mavenCentralUsername not found, which is required for publishing to Maven Central.

Root cause: the vanniktech maven-publish plugin (publishToMavenCentral()) reads the Gradle project properties mavenCentralUsername / mavenCentralPassword. Gradle populates a project property from the environment only when the env var is prefixed ORG_GRADLE_PROJECT_. release.yml exported the secrets under the wrong names (MAVEN_CENTRAL_USERNAME / MAVEN_CENTRAL_PASSWORD), so Gradle never surfaced them as those properties and the plugin reported them as not found.

The signing credentials directly below them already use the correct convention (ORG_GRADLE_PROJECT_signingInMemoryKey*) — the Maven Central credentials simply didn't follow the same pattern. This is a pre-existing Story-1.4 bug that only surfaced now that the pipeline reaches the publish step for the first time.

Change

In the Run semantic-release step's env: block, rename the two keys to the ORG_GRADLE_PROJECT_ form the plugin expects (secret references unchanged):

  • MAVEN_CENTRAL_USERNAMEORG_GRADLE_PROJECT_mavenCentralUsername
  • MAVEN_CENTRAL_PASSWORDORG_GRADLE_PROJECT_mavenCentralPassword

The adjacent comment is updated to note these are Gradle project properties consumed by the vanniktech plugin (same convention as the ORG_GRADLE_PROJECT_signingInMemoryKey* lines). No other change — signing vars, GITHUB_TOKEN, permissions, the gradle command, and release.config.mjs are untouched.

Verification

  • AC-1 (env-var prefix): verified — the env: block now exports ORG_GRADLE_PROJECT_mavenCentralUsername / ORG_GRADLE_PROJECT_mavenCentralPassword from the same secrets, and no MAVEN_CENTRAL_USERNAME / MAVEN_CENTRAL_PASSWORD keys remain.
  • AC-2 (local artifact assembly): already verified passing — ./gradlew :packages:sdk:publishToMavenLocalBUILD SUCCESSFUL (AAR + sources + javadoc + complete POM).
  • AC-3 (real release): definitive proof is the next Release run after merge.

Spec: qs-04 (maven-central-credential-env-vars).

🤖 Generated with Claude Code

The vanniktech maven-publish plugin reads the Gradle properties
`mavenCentralUsername`/`mavenCentralPassword`, which Gradle populates from
the environment only when prefixed `ORG_GRADLE_PROJECT_`. release.yml
exported the secrets as `MAVEN_CENTRAL_USERNAME`/`MAVEN_CENTRAL_PASSWORD`,
so the plugin never saw them and the publish step failed with
'mavenCentralUsername not found'. Rename to the prefixed form (same
convention the signing creds beside them already use); secret references
unchanged. (qs-04.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@abbaseya abbaseya self-assigned this Jun 4, 2026
@abbaseya
abbaseya requested a review from JosephSamirL June 4, 2026 01:22
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@abbaseya
abbaseya merged commit e234e9a into main Jun 4, 2026
10 checks passed
@abbaseya
abbaseya deleted the fix/maven-central-cred-env branch June 4, 2026 01:29
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