ramu11 commented on PR #27314:
URL: https://github.com/apache/camel/pull/27314#issuecomment-6076440107
> ## Re-review after `c8509194` — Jakarta Persistence exclusion removed
(regression)
> The single new commit removes the `jakarta.persistence-api` exclusion from
`parent/pom.xml`'s `dependencyManagement` entry for `camel-hibernate`.
>
> This is a **regression** relative to the previous state, not a fix.
>
> ### davsclaus's remaining issues
> # Issue Status
> 1 Jakarta Persistence 4 taking over in `camel-allcomponents` ❌
**Worsened** — see below
> 2 Failing row blocks consumer — docs note ✅ Addressed in docs
> 3 `hibernate8-version` leftover in `parent/pom.xml` ✅ Removed
> ### Why this commit makes issue #1 worse
> `camel-allcomponents` inherits from `catalog` → `camel-parent`
(`parent/pom.xml`). When `camel-allcomponents/pom.xml` declares
`camel-hibernate` as a dependency, it picks up the managed entry from
`parent/pom.xml`'s `<dependencyManagement>`.
>
> The **previous state** had an exclusion in `parent/pom.xml`'s managed
entry, which propagated to `camel-allcomponents` and prevented
`jakarta.persistence-api` 4.0.0-M7 from leaking into its classpath.
>
> The **new state** removes that exclusion entirely. `camel-hibernate`
declares `jakarta.persistence-api` 4.0.0-M7 as a compile-scoped dependency.
With no exclusion anywhere, it will now be resolved transitively in every
project that pulls in `camel-hibernate`, including `camel-allcomponents` and
any BOM user who adds `camel-hibernate`. This is precisely the concern
davsclaus raised.
>
> The correct fix depends on the intended isolation strategy:
>
> **Option A — revert this commit, restore the exclusion in
`parent/pom.xml`'s `dependencyManagement`:**
>
> ```
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-hibernate</artifactId>
> <version>${project.version}</version>
> <exclusions>
> <exclusion>
> <groupId>jakarta.persistence</groupId>
> <artifactId>jakarta.persistence-api</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> ```
>
> **Option B — add an explicit exclusion in `camel-allcomponents/pom.xml`**
(more targeted, does not affect BOM consumers):
>
> ```
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-hibernate</artifactId>
> <version>${project.version}</version>
> <exclusions>
> <exclusion>
> <groupId>jakarta.persistence</groupId>
> <artifactId>jakarta.persistence-api</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> ```
>
> **Option C — scope `jakarta.persistence-api` as `provided` in
`camel-hibernate/pom.xml`** (cleanest long-term): since Hibernate 8 already
bundles its own JPA provider, declaring the JPA API `provided` means it will
not appear as a runtime transitive dependency at all.
>
> Discuss with @davsclaus which option is preferred. The current commit
(removing the exclusion without replacing it) is not the right move.
>
> _This review was generated by an AI agent, Hermès on behalf of @gnodet._
Thanks for highlighting this. I removed the exclusion in `c85091945a9f`
following davsclaus's feedback that the exclusion in the generated
`parent/pom.xml` block breaks regeneration and does not resolve the Jakarta
Persistence version conflict in `camel-allcomponents` and the distribution.
I agree that the transitive dependency concern needs to be addressed, but I
don't want to introduce another change that conflicts with the generated POM
structure or the intended dependency model.
Could we confirm the preferred approach for this PR? My understanding from
the previous review was to leave the Jakarta Persistence version alignment open
for the Camel 4.24 platform upgrades and Hibernate 8 GA.
--
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]