Skip to content

build: make each Maven Central release 57% smaller - #367

Merged
cbetta merged 3 commits into
mainfrom
build/smaller-maven-central-release
Dec 4, 2026
Merged

cbetta merged 3 commits into
mainfrom
build/smaller-maven-central-release

Conversation

@cbetta

@cbetta cbetta commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Every merged regeneration releases com.gr4vy:sdk to Maven Central, and in November the releases used up the com.gr4vy namespace's monthly release-size limit (Sonatype ticket #131110). This makes each release 57% smaller without changing the API.

// build-extras.gradle — Speakeasy never overwrites this file
javadoc {
    actions = []        // no full javadoc; write index.html + README.md that link to
    doLast { ... }      // github.com/gr4vy/gr4vy-java/tree/v<version> (README, docs/) and docs.gr4vy.com
}
tasks.withType(JavaCompile).configureEach {
    options.debugOptions.debugLevel = "source,lines"   // was -g (all)
}

Measured with ./gradlew build on JDK 11, as the publish job builds it, at 2.19.44:

Artifact Before After
sdk-*-javadoc.jar 9.20 MB 0.001 MB
sdk-*.jar 5.58 MB 5.07 MB
sdk-*-sources.jar 2.22 MB 2.22 MB
Release 17.01 MB 7.30 MB

Warning

javadoc.io shows the placeholder page, not the class reference, for every version released after this. Merging this is a non-bot change, so the next release waits for approval in release-manual.

Sonatype allows this: "If you cannot provide sources or documentation, we allow uploading placeholder .jar files in order to pass validation" (requirements). IDEs show docs from the sources jar, which is unchanged. Stack traces keep file names and line numbers; a debugger stepping into SDK code no longer shows local variable names. Jackson uses the generated @JsonProperty annotations, not local variable tables.

Reviewer checks
Auth / secrets None
Data None
CI / deploy Build output only; workflows unchanged
Dependencies None

🤖 Generated with Claude Code

cbetta and others added 2 commits December 4, 2026 14:52
Trim the javadoc jar (no tree, index, search, help or deprecated list) and
compile without local variable tables. A release drops from 17.0 MB to
14.5 MB. The change lives in build-extras.gradle, which Speakeasy never
overwrites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Maven Central accepts a placeholder javadoc jar. The jar now holds one
index.html and a README.md that link to the README and docs/ at the
release tag. A release drops from 14.5 MB to 7.3 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cbetta cbetta changed the title build: make each Maven Central release smaller build: make each Maven Central release 57% smaller Dec 4, 2026
@cbetta
cbetta marked this pull request as ready for review December 4, 2026 15:20
Copilot AI lite review requested due to automatic review settings December 4, 2026 15:20

Copilot AI 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.

🟡 Changes recommended

An active moderate issue remains because sdkVersion is not declared as a javadoc input, allowing stale version-specific links and titles when building multiple SDK versions without cleaning.

1 open issue
What changed in this PR

Reduces Maven Central release size by replacing full Javadocs with lightweight placeholders and omitting local-variable debug metadata without changing the API.

Changes:

  • Generates minimal documentation artifacts linking to repository and hosted docs.
  • Retains source and line debug information while removing local-variable tables.
File Description
build-extras.gradle Configures lightweight Javadocs and reduced Java compiler debug metadata for smaller releases.

Review effort: Lite

Comment thread build-extras.gradle Resolved
The links and title use the SDK version, so make it a task input.
Otherwise a version-only change could reuse the old placeholder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI 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.

🔵 Needs a closer look

The Gradle task and Maven artifact changes require JDK 11 build verification to confirm correct Javadoc packaging and incrementality, but that runtime was unavailable.

No open issues 🎉

1 resolved since last review

Review effort: Lite

@cbetta
cbetta merged commit 25aaf1e into main Dec 4, 2026
11 checks passed
@cbetta
cbetta deleted the build/smaller-maven-central-release branch December 4, 2026 15:30
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.

2 participants