gnodet opened a new pull request, #30375:
URL: https://github.com/apache/camel/pull/30375
## Summary
Pin `protobuf-java` to the 4.x version required by `google-cloud-aiplatform`
in the `camel-google-vertexai` module, preventing endpoint startup failures in
Camel JBang and standalone applications.
## Root Cause
`google-genai:2.0.0` declares `protobuf-java:3.25.5` as a **direct compile
dependency** (depth 2 from the component). Without the Camel parent BOM's
`dependencyManagement` in scope (which pins it to 4.35.1), Maven's nearest-wins
mediation rule selects `protobuf-java:3.25.5` over the `protobuf-java:4.x`
required by `proto-google-cloud-aiplatform-v1` (which sits deeper in the
`google-cloud-aiplatform` tree). This causes a `ClassNotFoundException` /
binary incompatibility when the endpoint tries to start, because
`com.google.protobuf.Message` from protobuf 3.x is not compatible with what
`proto-google-cloud-aiplatform-v1-3.103.0.jar` was compiled against.
The issue does **not** manifest when building with the full Camel parent POM
(which includes the `dependencyManagement` override), which is why the existing
build is unaffected — but Camel JBang users and downstream applications that
consume only `camel-google-vertexai` as a Maven artifact are impacted.
## Fix
- Exclude `protobuf-java` from the `google-genai` dependency (so the 3.25.5
artifact is never brought onto the classpath from that path).
- Add an explicit `com.google.protobuf:protobuf-java:${protobuf-version}`
(4.35.1) dependency, mirroring the existing pattern used for
`google-auth-library-oauth2-http` and `google-auth-library-credentials` in the
same pom.
This is a **single-file, minimal change** consistent with the existing
dependency conflict resolution pattern already in this module.
## Tests
All 39 existing unit tests pass. The fix is verified by running
`dependency:tree -Dincludes=com.google.protobuf` before and after: previously
`google-genai` contributed `protobuf-java:3.25.5`; after the fix it is excluded
and `protobuf-java:4.35.1` resolves from the explicit dependency.
Fixes CAMEL-27188
---
_Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]