Skip to content

fix: attach library component to Maven publication - #3

Merged
rayworks merged 1 commit into
masterfrom
fix_maven_publication
Jul 8, 2026
Merged

fix: attach library component to Maven publication#3
rayworks merged 1 commit into
masterfrom
fix_maven_publication

Conversation

@rayworks

@rayworks rayworks commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Problem

Publishing via :crashreporter:publishReleasePublicationToGitHubPackagesRepository uploaded only a bare POM — the AAR (and dependency metadata) never made it to GitHub Packages.

Root cause

The MavenPublication blocks in upload_maven.gradle set the Maven coordinates but never attached the library component (from components.release), so the publication had no artifacts and an empty dependency list.

Changes

  • Add from components.release to the release publication so the AAR, sources jar, Gradle module metadata and POM dependencies are published
  • Add android.publishing.singleVariant("release") { withSourcesJar() } to crashreporter/build.gradle — required on AGP 8.x for components.release to exist
  • Remove the debug publication: it used the exact same groupId:artifactId:version as the release publication, so the two would clobber each other (GitHub Packages rejects duplicate versions with HTTP 409)
  • Bump lib_version to 1.4.2

Verification

Ran :crashreporter:publishReleasePublicationToMavenLocal; the publication now contains:

  • crashreporter.aar including classes.jar, jni/arm64-v8a/libbreakpad-core.so (16 KB aligned) and jni/armeabi-v7a/libbreakpad-core.so
  • -sources.jar
  • POM with the 7 library dependencies (previously none)
  • Gradle module metadata

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Release builds are now prepared for publishing with source code included, making published artifacts more complete for consumers.
    • Maven publishing has been updated to use a newer release, improving the publishing workflow and artifact generation.

The release publication only set Maven coordinates without attaching
any artifacts, so publishing to GitHub Packages uploaded a bare POM
with no AAR and no dependency metadata.

- Add `from components.release` so the AAR, sources jar and POM
  dependencies are published
- Opt in via `android.publishing.singleVariant("release")`, required
  for `components.release` to exist on AGP 8.x
- Remove the debug publication: it shared the exact same GAV
  coordinates as the release one, so the two would conflict
- Bump version to 1.4.2

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0271e19-f273-4899-aabe-6f5b8ed4cef5

📥 Commits

Reviewing files that changed from the base of the PR and between 9e86739 and cbcc773.

📒 Files selected for processing (2)
  • crashreporter/build.gradle
  • crashreporter/upload_maven.gradle

📝 Walkthrough

Walkthrough

Configures Maven publishing for the crashreporter module. Adds an android publishing block enabling the release variant with sources JAR, and updates upload_maven.gradle to bump the library version and derive the release publication from components.release instead of explicit coordinates.

Changes

Maven Publishing Setup

Layer / File(s) Summary
Release publishing configuration
crashreporter/build.gradle, crashreporter/upload_maven.gradle
Adds android publishing block for the release single variant with sources JAR, bumps lib_version to 1.4.2, and changes the release MavenPublication to use from components.release instead of explicit groupId/artifactId/version.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: attaching the library component to the Maven publication.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_maven_publication

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rayworks
rayworks merged commit 1046326 into master Jul 8, 2026
2 checks passed
@rayworks
rayworks deleted the fix_maven_publication branch July 8, 2026 08: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