Repository navigation
Cut the Maven Central publishing footprint by 64% - #3589
Conversation
Sonatype is enforcing per-organization publishing limits on Maven Central (78 MB, 1167 files, 7 releases per month, on 3-month averages), with rate limiting starting 2026-10-01. The 7.4.4 release consumed 48.91 MB across 198 files, so three releases in a month would be nearly double the size cap. Five changes, in descending order of savings: - oshi-dist ships a single .zip instead of the same content in three compression formats. Two thirds of oshi-dist's 27.01 MB was pure format duplication. - oshi-dist no longer bundles oshi-demo, which dragged jfreechart and the three jackson artifacts into lib/. This is a correctness fix as much as a size one: someone downloading the archive to put oshi-core on a classpath was getting example-only code and its dependencies. It also means no published OSHI artifact redistributes jackson binaries any more, so a jackson CVE becomes an ordinary Renovate bump in demo code. - oshi-common's javadoc is no longer inlined into the oshi-core and oshi-core-ffm javadoc jars, where it was over half of each (measured: 6.23 MB -> 1.93 MB for oshi-core, 6.26 MB -> 1.97 MB for oshi-core-ffm). oshi-common publishes its own javadoc jar and IDEs resolve javadoc per-artifact, so IDE users see no change. The <reporting> copies stay, because reporting configuration does not inherit from build, so the published site remains self-contained and fully cross-linked. - test-javadoc jars are no longer published. A survey of 20 well-known Central artifacts found none that documents its own tests; this was the one genuinely off-pattern thing OSHI published. - oshi-benchmark is excluded from the release entirely, via excludeArtifacts. Its own pom already claimed it was not published. Verified against a staged central-bundle.zip: 46.61 MB across 33 artifacts (198 files) becomes 16.94 MB across 23 artifacts (138 files), a 64% reduction. Scaling by the sidecar overhead implied by Sonatype's own 48.91 MB figure for 7.4.4, that is ~17.8 MB per release, so three releases a month sits at roughly 68% of the size cap and four at 91%. Sources and javadoc jars are otherwise untouched; Sonatype's reduction guidance names them as expected parts of a standard release. Also attach the dist zip to each GitHub release, which previously carried no assets beyond the auto-generated source tarballs. The zip stays on Central, which remains authoritative -- rebuilt jars are functionally identical but not byte-identical, since the manifest carries a Build-Time.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (10)
📝 WalkthroughWalkthroughThe release process now builds a single ZIP distribution without demo artifacts, publishes fewer Maven Central artifacts, removes test Javadocs, and attaches the distribution archive to GitHub Releases. Documentation describes the updated download and release procedures. ChangesDistribution publishing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubRelease
participant DistReleaseWorkflow
participant Maven
participant GitHubAssets
GitHubRelease->>DistReleaseWorkflow: Trigger on published release
DistReleaseWorkflow->>Maven: Build oshi-dist ZIP
Maven-->>DistReleaseWorkflow: Return generated ZIP
DistReleaseWorkflow->>GitHubAssets: Upload or replace release asset
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3589 +/- ##
============================================
- Coverage 79.88% 79.82% -0.06%
- Complexity 4105 4228 +123
============================================
Files 710 710
Lines 24242 24242
Branches 4052 4052
============================================
- Hits 19365 19351 -14
- Misses 2722 2729 +7
- Partials 2155 2162 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/dist-release.yaml:
- Line 24: Update the checkout ref configuration in the dist-release workflow so
the manual inputs.tag value is resolved exclusively as a tag reference, such as
by prefixing it with refs/tags/. Preserve the existing
github.event.release.tag_name behavior for release-triggered runs.
In `@CHANGELOG.md`:
- Around line 3-5: Change the “Bug Fixes and Improvements” heading from its
current level-five Markdown heading to a level-two heading, preserving the
existing section title and changelog entries.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9fc03568-d5a9-4f76-a01f-dba70721ae9e
📒 Files selected for processing (13)
.github/workflows/dist-release.yamlAGENTS.mdCHANGELOG.mdREADME.mdRELEASING.mdUPGRADING.mdoshi-benchmark/pom.xmloshi-core-ffm/pom.xmloshi-core/pom.xmloshi-dist/pom.xmloshi-dist/src/assembly/assembly.xmlpom.xmlsrc/site/markdown/index.md
📜 Review details
⏰ Context from checks skipped due to timeout. (11)
- GitHub Check: Test JDK 25, OpenIndiana (+ JNA==FFM)
- GitHub Check: Test JDK 25, FreeBSD (+ JNA==FFM)
- GitHub Check: Test JDK 25, OpenBSD (+ JNA==FFM)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Analyze (java)
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, ubuntu-latest
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: Test JDK 26, ubuntu-latest
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{java,xml,properties}
📄 CodeRabbit inference engine (AGENTS.md)
Run repository formatting and checks through the configured tools: Spotless owns formatting/import order/license headers, and Checkstyle/import-control enforce style and imports.
Files:
oshi-benchmark/pom.xmloshi-core/pom.xmloshi-core-ffm/pom.xmloshi-dist/pom.xmlpom.xmloshi-dist/src/assembly/assembly.xml
CHANGELOG.md
📄 CodeRabbit inference engine (AGENTS.md)
Add a
Next Releasechangelog entry only for user-visible changes; omit pure refactors, deduplication, test-only changes, and CI configuration changes.
Files:
CHANGELOG.md
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: oshi/oshi
Timestamp: 2026-08-07T17:54:36.560Z
Learning: Only build and test platform-specific behavior on the platform and hardware where it can actually run; do not assume a green local build verifies other platforms.
Learnt from: CR
Repo: oshi/oshi
Timestamp: 2026-08-07T17:54:36.560Z
Learning: Do not add dependencies without discussion or manually bump dependency versions; do not commit generated output, `target/`, or IDE files.
📚 Learning: 2026-05-31T05:53:04.246Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3311
File: .github/workflows/site.yaml:21-21
Timestamp: 2026-05-31T05:53:04.246Z
Learning: When a GitHub Actions workflow verifies that a pinned commit SHA matches a version tag, dereference annotated tags before comparing to a commit SHA. The API `GET /repos/{owner}/{repo}/git/refs/tags/{tag}` returns the tag *object* SHA for annotated tags (not the underlying commit SHA), so comparing it directly to a commit SHA will cause false mismatches. Instead: (1) fetch the tag object SHA via `GET /repos/{owner}/{repo}/git/refs/tags/{tag}`; (2) resolve that tag object to the underlying commit by calling `GET /repos/{owner}/{repo}/git/tags/{tag_object_sha}`; (3) compare the pinned commit SHA to the resolved commit at `.object.sha`.
Applied to files:
.github/workflows/dist-release.yaml
📚 Learning: 2026-07-21T20:38:16.728Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3509
File: oshi-demo/pom.xml:72-80
Timestamp: 2026-07-21T20:38:16.728Z
Learning: For the OSHI Maven/Jacoco CI workflows, coverage aggregation/report upload steps should run only when the test job succeeds (e.g., guard with conditions like `if: success()`). Do not add logic to generate/upload or preserve aggregate coverage artifacts after test failures, and avoid fragile/over-engineered handling of exit status unless there is an explicit separate project requirement.
Applied to files:
.github/workflows/dist-release.yaml
🪛 markdownlint-cli2 (0.23.2)
CHANGELOG.md
[warning] 3-3: Heading levels should only increment by one level at a time
Expected: h2; Actual: h5
(MD001, heading-increment)
🪛 zizmor (1.29.0)
.github/workflows/dist-release.yaml
[error] 27-27: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): this step
(cache-poisoning)
🔇 Additional comments (12)
oshi-dist/pom.xml (1)
15-15: LGTM!Also applies to: 33-34, 42-42
oshi-dist/src/assembly/assembly.xml (1)
8-8: LGTM!Also applies to: 32-34, 43-44
.github/workflows/dist-release.yaml (1)
1-21: LGTM!Also applies to: 22-23, 25-26, 30-31, 32-39, 40-44
RELEASING.md (1)
86-100: LGTM!README.md (1)
65-65: LGTM!src/site/markdown/index.md (1)
65-65: LGTM!UPGRADING.md (1)
17-17: LGTM!AGENTS.md (1)
29-29: LGTM!pom.xml (1)
1002-1007: LGTM!oshi-benchmark/pom.xml (1)
25-28: LGTM!Also applies to: 153-160
oshi-core-ffm/pom.xml (1)
103-103: LGTM!Also applies to: 119-121
oshi-core/pom.xml (1)
131-131: LGTM!Also applies to: 157-159
actions/checkout resolves an unqualified ref by looking for a matching branch before a matching tag (getCheckoutInfo in src/ref-helper.ts calls branchExists first, falling back to tagExists). Both values this workflow passes are always release tags, so a branch that happened to share a tag's name would silently check out the branch and package the wrong commit. Prefix with refs/tags/, which takes the explicit refs/tags/ branch of that resolution. The TAG env var on the upload step stays unqualified: gh release upload takes a tag name, not a ref.
The next release earns a minor bump rather than a patch, on the strength of changes already merged plus what is queued. #3589 is the concrete reason. It cut the Maven Central publishing footprint by 64%: oshi-dist now ships a single .zip instead of three identical archives in three compression formats, no longer bundles oshi-demo or its jfreechart/jackson dependencies, and oshi-benchmark is no longer published at all. None of that breaks the API, but anyone who was fetching the .tar.gz or .tar.bz2, or relying on oshi-demo being inside the dist zip, has a breaking experience - which should not arrive labeled as a patch release. Queued behind it is the jSpecify nullability work proposed in #3593, which adds a new set of annotations across the public API. RELEASING.md calls for a minor bump for "substantive additions, bugfixes and changes that are backwards compatible"; both of these qualify. Bumping now rather than at release time also puts the #3589 CHANGELOG entry under the correct heading from the start instead of moving it later.
Everything sat under "Bug Fixes and Improvements", which put the release's headline change in the wrong place and left one entry carrying three different kinds of change at once. New Features: the JSpecify adoption, rewritten to lead with what a consumer gets rather than what the sweep did to the build, and ParseUtil's new getStringValueOrEmpty, which was a clause in the middle of that paragraph. Behavior Changes: the null-to-sentinel list, promoted out of its sub-bullet. Someone whose code tests those getters for null now has dead branches, and that was the least visible thing in the section. #3616 moves here from Bug Fixes, being the same kind of change. Removals: #3608's 14 WMI forwarding shims, Util.isBlankOrUnknown and ParseUtil.slash, with a note that they sit outside the semver-guaranteed API and are listed only because removing them can break a compile. Bug Fixes and Improvements keeps #3589 and #3611/#3612, gains the hardening work split out of the JSpecify entry, and gains #3639, which had no entry at all: the Windows GPU utilization path tested its cached tick sample for null and then dereferenced it in a second read, so a concurrent poll could throw. Dependency bumps get no entries; none changed anything user-visible.
Sonatype is enforcing per-organization publishing limits on Maven Central — 78 MB release size, 1167 files, 7 releases per month, evaluated on three-month averages. Soft limits (warnings only) have been in effect since 2026-06-16; rate limiting begins 2026-10-01.
The 7.4.4 release consumed 48.91 MB across 198 files. At that rate three releases in a month is nearly double the size cap, so this trims what we publish without giving up anything a consumer uses.
Result
Measured against a staged
central-bundle.zip, not estimated:Scaling by the sidecar overhead implied by Sonatype's own 48.91 MB figure for 7.4.4 gives ~17.8 MB per release: three releases a month sits at 68% of the size cap (was 188%), four at 91%. Release count and file count were never close to their limits and now sit at 24% and 28%.
What changed, largest saving first
oshi-distships one.zipinstead of three archives. The.zip,.tar.gzand.tar.bz2held byte-identical content at ~9 MB each, so two thirds ofoshi-dist's 27.01 MB was pure compression-format duplication.oshi-distno longer bundlesoshi-demo. This is a correctness fix as much as a size one — anyone downloading the archive to putoshi-coreon a classpath was also gettingjfreechartand threejacksonartifacts from example-only code. The archive is now 27.01 MB → 4.94 MB and contains exactlyoshi-common,oshi-core,oshi-core-ffm,license.txt, andlib/{jna-jpms,jna-platform-jpms,slf4j-api}. Side benefit: no published OSHI artifact redistributes Jackson bytes any more, so a Jackson CVE becomes an ordinary Renovate bump in demo code.oshi-common's javadoc is no longer inlined into theoshi-core/oshi-core-ffmjavadoc jars, where it was more than half of each: 6.23 → 1.93 MB and 6.26 → 1.97 MB.oshi-commonpublishes its own javadoc jar and IDEs resolve javadoc per-artifact, so IDE users see no change. Only a standalone unzipped browse of one jar loses cross-links. Matches what jackson-databind and micrometer-core do.The
<reporting>copies are deliberately kept, with a comment explaining why. Reporting configuration does not inherit from<build>, so the published site stays self-contained and fully cross-linked — verified below.No more
test-javadocjars. A survey of 20 well-known Central artifacts found 0/10 peers publishing javadoc for their own tests; this was the one genuinely off-pattern thing we shipped. Sonatype's reduction guide names "tool-generated supplementary files" as reduction candidates while explicitly protecting sources and javadoc jars, which are otherwise untouched here.oshi-benchmarkis no longer published, viaexcludeArtifacts. Its own pom already claimed it wasn't.Also: the dist zip is now attached to each GitHub release, which previously carried no assets beyond GitHub's auto-generated source tarballs.
Verification
centralBaseUrlso the bundle is written but not uploaded: 0test-javadocentries, 0oshi-benchmarkentries, exactly oneoshi-dist.zip. 115 entries = 23 artifacts × 5 (gpg skipped), matching the predicted count.jfreechart/jackson/oshi-demo, and no.tar.*produced. Dropping the module from themoduleSetremoved its transitive deps fromlib/on its own, so no explicitdependencySetexcludes were needed.oshi-core/target/site/apidocs/com.github.oshi.common/oshi/util/ParseUtil.htmlexists, while the publishedoshi-core-javadoc.jarno longer containsoshi/util/ParseUtil.html. That split is the whole basis of change 3.-Prelease clean installpasses. This was the real risk:javadoc:jarruns only in thereleaseprofile and is stricter about unresolved{@link}s than thejavadoc:javadocreport goal used in the normal gate.spotless:check,checkstyle:check,forbiddenapis:check+testCheck,javadoc:javadoc,verify-slf4j-17), andmvn test -Paggregate-coveragepasses.No Java source is touched — this is poms, an assembly descriptor, one new workflow, and docs.
dist-release.yamltriggers onrelease: published, which per RELEASING.md is the last manual release step. It must be merged before the nextrelease:preparecuts a tag, or the checked-out tag won't contain it and nothing fires.RELEASING.mddocuments that, plus agh workflow run dist-release.yaml -f tag=...retry (which also backfills older tags) and a manualgh release uploadfallback.Since the zip remains on Central, a missed asset is a cosmetic gap rather than a distribution outage. Rebuilt jars are functionally identical to Central's but not byte-identical — the manifest carries a
Build-Timeand noproject.build.outputTimestampis set — so the Central copy stays authoritative.One caveat
excludeArtifactslogs nothing when it matches (unlikeskipPublishing), so a typo there fails open and publishes the module anyway. Bundle inspection is the only check; worth re-running the staged-bundle step if that config is ever edited.Summary by CodeRabbit
New Features
oshi-distZIP containing OSHI modules and runtime dependencies.Improvements
Documentation