Skip to content

Gradle gRPC support fails if protobuf-java dependency is used instead of protobuf-java-util#50405

Merged
philwebb merged 2 commits into
spring-projects:mainfrom
DragonFSKY:fix/50401-grpc-client-protobuf-alignment
May 12, 2026
Merged

Gradle gRPC support fails if protobuf-java dependency is used instead of protobuf-java-util#50405
philwebb merged 2 commits into
spring-projects:mainfrom
DragonFSKY:fix/50401-grpc-client-protobuf-alignment

Conversation

@DragonFSKY
Copy link
Copy Markdown
Contributor

Fixes #50401.

This updates the Protobuf Gradle plugin action to align protoc with com.google.protobuf:protobuf-java rather than protobuf-java-util. The gRPC client starter brings in protobuf-java but not protobuf-java-util, so the previous alignment could leave protoc with a null version.

The integration test fixture now uses protobuf-java, and a generateProto coverage case with a proto source file verifies the client-style setup.

Tests:

  • ./gradlew :build-plugin:spring-boot-gradle-plugin:test --tests org.springframework.boot.gradle.plugin.ProtobufPluginActionIntegrationTests --rerun-tasks
  • ./gradlew :build-plugin:spring-boot-gradle-plugin:test --tests org.springframework.boot.gradle.plugin.ProtobufPluginActionIntegrationTests :build-plugin:spring-boot-gradle-plugin:checkFormatMain :build-plugin:spring-boot-gradle-plugin:checkFormatTest :build-plugin:spring-boot-gradle-plugin:checkstyleMain :build-plugin:spring-boot-gradle-plugin:checkstyleTest

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 12, 2026
@philwebb philwebb marked this pull request as ready for review May 12, 2026 15:34
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels May 12, 2026
@philwebb philwebb added this to the 4.1.0 milestone May 12, 2026
@philwebb philwebb self-assigned this May 12, 2026
@philwebb philwebb changed the title Align protoc version with protobuf-java Gradle gRPC support fails if protobuf-java dependency is used instead of protobuf-java-util May 12, 2026
philwebb and others added 2 commits May 12, 2026 08:56
Simplify the stream logic to make use of `getAllComponents()`
rather than using `getAllDependencies()` and
`DependencyResult::getFrom`.

See spring-projectsgh-50405
Update `ProtobufPluginAction` to align the protoc version with
`protobuf-java` rather than `protobuf-java-util`. The util
jar is only required for server gRPC code.

See spring-projectsgh-50405

Signed-off-by: Dongliang Xie <dragonfsky@gmail.com>
@philwebb philwebb force-pushed the fix/50401-grpc-client-protobuf-alignment branch from 68395ca to 6d307ed Compare May 12, 2026 16:09
@philwebb philwebb merged commit 1bd43a0 into spring-projects:main May 12, 2026
1 check failed
@philwebb
Copy link
Copy Markdown
Member

Thanks very much @DragonFSKY. I've applied this to main, but I split it into two commits (one for the stream simplification and one for the fix).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gRPC client project build fails

3 participants