Skip to content

Cut the Maven Central publishing footprint by 64% - #3589

Merged
dbwiddis merged 2 commits into
oshi:masterfrom
dbwiddis:reduce-central-publishing-footprint
Aug 7, 2026
Merged

dbwiddis merged 2 commits into
oshi:masterfrom
dbwiddis:reduce-central-publishing-footprint

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

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:

7.4.4 after
release size 46.61 MB 16.94 MB −64%
artifacts 33 23
files 198 138 −30%

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

  1. oshi-dist ships one .zip instead of three archives. The .zip, .tar.gz and .tar.bz2 held byte-identical content at ~9 MB each, so two thirds of oshi-dist's 27.01 MB was pure compression-format duplication.

  2. oshi-dist no longer bundles oshi-demo. This is a correctness fix as much as a size one — anyone downloading the archive to put oshi-core on a classpath was also getting jfreechart and three jackson artifacts from example-only code. The archive is now 27.01 MB → 4.94 MB and contains exactly oshi-common, oshi-core, oshi-core-ffm, license.txt, and lib/{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.

  3. oshi-common's javadoc is no longer inlined into the oshi-core / oshi-core-ffm javadoc jars, where it was more than half of each: 6.23 → 1.93 MB and 6.26 → 1.97 MB. oshi-common publishes 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.

  4. No more test-javadoc jars. 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.

  5. oshi-benchmark is no longer published, via excludeArtifacts. 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

  • Staged bundle in a throwaway worktree at version 99.9.9, deploying to an unreachable centralBaseUrl so the bundle is written but not uploaded: 0 test-javadoc entries, 0 oshi-benchmark entries, exactly one oshi-dist .zip. 115 entries = 23 artifacts × 5 (gpg skipped), matching the predicted count.
  • Archive contents: 8 entries, no jfreechart/jackson/oshi-demo, and no .tar.* produced. Dropping the module from the moduleSet removed its transitive deps from lib/ on its own, so no explicit dependencySet excludes were needed.
  • Site javadoc still inlines: oshi-core/target/site/apidocs/com.github.oshi.common/oshi/util/ParseUtil.html exists, while the published oshi-core-javadoc.jar no longer contains oshi/util/ParseUtil.html. That split is the whole basis of change 3.
  • -Prelease clean install passes. This was the real risk: javadoc:jar runs only in the release profile and is stricter about unresolved {@link}s than the javadoc:javadoc report goal used in the normal gate.
  • Full gate green (spotless:check, checkstyle:check, forbiddenapis:check+testCheck, javadoc:javadoc, verify-slf4j-17), and mvn test -Paggregate-coverage passes.
  • The new workflow's exact build command was run locally and produces a zip matching its upload glob.

No Java source is touched — this is poms, an assembly descriptor, one new workflow, and docs.

⚠️ Sequencing

dist-release.yaml triggers on release: published, which per RELEASING.md is the last manual release step. It must be merged before the next release:prepare cuts a tag, or the checked-out tag won't contain it and nothing fires. RELEASING.md documents that, plus a gh workflow run dist-release.yaml -f tag=... retry (which also backfills older tags) and a manual gh release upload fallback.

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-Time and no project.build.outputTimestamp is set — so the Central copy stays authoritative.

One caveat

excludeArtifacts logs nothing when it matches (unlike skipPublishing), 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

    • Releases now provide a single oshi-dist ZIP containing OSHI modules and runtime dependencies.
    • Distribution archives are automatically attached to GitHub Releases.
  • Improvements

    • Demo components and dependencies are excluded from distribution archives.
    • Benchmark artifacts and test Javadocs are no longer published.
    • Javadoc packaging is streamlined to reduce duplication.
  • Documentation

    • Updated download, upgrade, and release instructions to explain the new distribution format and GitHub Release availability.

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.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 07ed50cc-b0ca-4ae5-9e99-20d4634935a5

📥 Commits

Reviewing files that changed from the base of the PR and between ec6c75b and 30377f5.

📒 Files selected for processing (1)
  • .github/workflows/dist-release.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/dist-release.yaml
📜 Recent review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: Test JDK 25, OpenIndiana (+ JNA==FFM)
  • GitHub Check: Test JDK 25, OpenBSD (+ JNA==FFM)
  • GitHub Check: Test JDK 25, FreeBSD (+ JNA==FFM)
  • GitHub Check: Test JDK 26, ubuntu-latest
  • GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
  • GitHub Check: Analyze (java)
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: Codacy Static Code Analysis

📝 Walkthrough

Walkthrough

The 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.

Changes

Distribution publishing

Layer / File(s) Summary
ZIP distribution contents
oshi-dist/pom.xml, oshi-dist/src/assembly/assembly.xml, AGENTS.md
oshi-dist now produces one ZIP containing OSHI JAR files and dependencies. TAR archives and oshi-demo are removed.
Maven Central artifact reduction
pom.xml, oshi-benchmark/pom.xml, oshi-core/pom.xml, oshi-core-ffm/pom.xml
Central Publishing excludes oshi-benchmark. Release builds no longer attach test Javadocs. Core Javadocs document site-only oshi-common inlining.
GitHub Release archive attachment
.github/workflows/dist-release.yaml, RELEASING.md, README.md, src/site/markdown/index.md, UPGRADING.md, CHANGELOG.md
A workflow builds and uploads the ZIP for release tags or manual dispatch. User and release documentation describes the new archive and publishing process.

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
Loading

Possibly related PRs

  • oshi/oshi#3127: Related Maven publication and benchmark configuration changes.
  • oshi/oshi#3217: Related Maven build configuration changes across benchmark and core modules.
  • oshi/oshi#3486: Related oshi-benchmark/pom.xml SonarCloud exclusion configuration.

Poem

A rabbit packs one ZIP with care,
No demo carrots hiding there.
Maven sheds its extra load,
GitHub hangs the release code.
Javadocs hop to sites anew—
Release day shines in bunny blue!

🚥 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: reducing the Maven Central publishing footprint.
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

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.

@codecov

codecov Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.82%. Comparing base (fc9eef6) to head (30377f5).
⚠️ Report is 2 commits behind head on master.

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     
Flag Coverage Δ
freebsd 33.49% <ø> (-0.01%) ⬇️
linux 37.61% <ø> (-0.05%) ⬇️
macos 38.43% <ø> (-0.03%) ⬇️
openbsd 32.66% <ø> (-0.03%) ⬇️
solaris 34.17% <ø> (+0.04%) ⬆️
windows 45.37% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7a90e2f and ec6c75b.

📒 Files selected for processing (13)
  • .github/workflows/dist-release.yaml
  • AGENTS.md
  • CHANGELOG.md
  • README.md
  • RELEASING.md
  • UPGRADING.md
  • oshi-benchmark/pom.xml
  • oshi-core-ffm/pom.xml
  • oshi-core/pom.xml
  • oshi-dist/pom.xml
  • oshi-dist/src/assembly/assembly.xml
  • pom.xml
  • src/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.xml
  • oshi-core/pom.xml
  • oshi-core-ffm/pom.xml
  • oshi-dist/pom.xml
  • pom.xml
  • oshi-dist/src/assembly/assembly.xml
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

Add a Next Release changelog 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

Comment thread .github/workflows/dist-release.yaml Resolved
Comment thread CHANGELOG.md Resolved
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.
@dbwiddis
dbwiddis merged commit 29737cf into oshi:master Aug 7, 2026
16 checks passed
@dbwiddis
dbwiddis deleted the reduce-central-publishing-footprint branch August 7, 2026 18:20
dbwiddis added a commit that referenced this pull request Aug 14, 2026
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.
dbwiddis added a commit that referenced this pull request Aug 16, 2026
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.
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