Skip to content

fix(build): skip errorprone publishing on JDK 8 - #142

Closed
halibobo1205 wants to merge 1 commit into
developfrom
fix/errorprone-publish-jdk8
Closed

fix(build): skip errorprone publishing on JDK 8#142
halibobo1205 wants to merge 1 commit into
developfrom
fix/errorprone-publish-jdk8

Conversation

@halibobo1205

@halibobo1205 halibobo1205 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Disables the errorprone module's Maven publish tasks on JDK 8, matching the existing compile and jar skips:

// No jar is produced, so the root maven-publish setup must not try to publish one
tasks.withType(AbstractPublishToMaven).configureEach { enabled = false }

This is intentionally limited to a two-line change in errorprone/build.gradle.

Why are these changes required?

errorprone is a compile-time-only module. Its error_prone_check_api and error_prone_core 2.42.0 dependencies contain Java 17 bytecode, which JDK 8 cannot read. The module therefore already disables its JavaCompile and Jar tasks on JDK 8, so no jar is produced.

However, the root build.gradle applies maven-publish to every subproject and publishes components.java. As a result, the aggregate Maven publish tasks still try to publish the missing errorprone jar:

> Task :errorprone:jar SKIPPED
> Task :errorprone:publishMavenJavaPublicationToMavenLocal FAILED
  > Artifact errorprone-1.0.0.jar wasn't produced by this build.

The failure is visible in the JitPack build log for GreatVoyage-v4.8.2.

The architecture gate requires JDK 8 on x86_64, so publishToMavenLocal and publish consistently fail on that architecture. This also breaks the installation command in jitpack.yml.

The failure only affects Maven publishing. Regular JDK 8 builds remain unaffected because no module applies the Error Prone plugin or depends on this jar in that configuration. The JDK 17 path is unchanged and continues to compile, package, and publish the module normally.

This PR has been tested by:

  • Manual Testing

No unit test is added because this is a Gradle build-script configuration change with no Java code involved.

Check Result
publishMavenJavaPublicationToMavenLocal with JDK 8 on x86_64 SKIPPED; build succeeds
Same command with the change reverted Fails with Artifact errorprone-1.0.0.jar wasn't produced by this build.
errorprone task states on JDK 17 compileJava, jar, and the publish task remain enabled
Full jitpack.yml installation command on JDK 17 Build succeeds and all modules are published
./gradlew lint Passes

Follow up

  • The existing guard uses isJava11Compatible() and its comment says JDK 11+, while Error Prone 2.42.0 actually requires JDK 17. This is currently masked by the architecture gate, which permits only JDK 8 on x86_64 or JDK 17 on arm64. The guard and comment should be aligned when the JDK 21 work relaxes that gate.
  • Adding a JDK 8/x86_64 CI job that runs the installation command from jitpack.yml would catch similar publishing regressions.

Extra details

The regression was introduced in tronprotocol#6698, which added the JDK 8 compile and jar skips but did not disable the corresponding publish tasks.

@codeant-ai

codeant-ai Bot commented Aug 7, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed 91127c2 Aug 24, 2026 · 08:57 08:57
✅ Reviewed your PR 84f0995 Aug 07, 2026 · 09:40 09:40

@codeant-ai

codeant-ai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@halibobo1205 halibobo1205 changed the title build(errorprone): skip Maven publish on JDK 8 fix(build): skip errorprone publishing on JDK 8 Aug 24, 2026
@halibobo1205
halibobo1205 force-pushed the fix/errorprone-publish-jdk8 branch from 84f0995 to 91127c2 Compare August 24, 2026 08:57
@codeant-ai

codeant-ai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

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