fix(build): skip errorprone publishing on JDK 8 - #6924
Open
halibobo1205 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Disables the
errorpronemodule's Maven publish tasks on JDK 8, matching the existing compile and jar skips:This is intentionally limited to a two-line change in
errorprone/build.gradle.Why are these changes required?
errorproneis a compile-time-only module. Itserror_prone_check_apianderror_prone_core2.42.0 dependencies contain Java 17 bytecode, which JDK 8 cannot read. The module therefore already disables itsJavaCompileandJartasks on JDK 8, so no jar is produced.However, the root
build.gradleappliesmaven-publishto every subproject and publishescomponents.java. As a result,publishToMavenLocalstill tries to publish the missingerrorpronejar:The original failure is visible in the JitPack build log for GreatVoyage-v4.8.2.
The architecture gate requires JDK 8 on
x86_64, sopublishToMavenLocalconsistently fails on that architecture. This also breaks the installation command injitpack.yml. Thepublishtask is unaffected, because no publishing repository is configured and it therefore resolves to an empty lifecycle task.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.
generatePomFileForMavenJavaPublicationandgenerateMetadataFileForMavenJavaPublicationare notAbstractPublishToMaventasks, so they still run on JDK 8. They only write files into the build directory, and nothing is installed oncepublishMavenJavaPublicationToMavenLocalis disabled.This PR has been tested by:
No unit test is added because this is a Gradle build-script configuration change with no Java code involved.
publishMavenJavaPublicationToMavenLocalwith JDK 8 onx86_64SKIPPED; build succeedsArtifact errorprone-1.0.0.jar wasn't produced by this build.errorpronetask states on JDK 17compileJava,jar, and the publish task remain enabledjitpack.ymlinstallation command on JDK 17./gradlew lintFollow up
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 onx86_64or JDK 17 onarm64. The guard and comment should be aligned when the JDK 21 work relaxes that gate.x86_64CI job that runs the installation command fromjitpack.ymlwould catch similar publishing regressions. No current workflow runspublishToMavenLocal.Extra details
The regression was introduced in #6698, which added the JDK 8 compile and jar skips but did not disable the corresponding publish tasks.