1

I'm using the Spring IO 1.0.1 BOM to manage my dependencies for my project. I've imported it in my super-pom's dependency management section like this -

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.spring.platform</groupId>
            <artifactId>platform-bom</artifactId>
            <version>1.0.1.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
...

Now, in a submodule POM of my project, I've declared these dependencies

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
    </dependency>
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.0-api</artifactId>
    </dependency>

And my final packaged war includes both hibernate-jpa-2.0 and hibernate-jpa-2.1. Since the entity manager depends on 2.1 and the api is 2.0. These are causing conflicts within my deployed app.

I cannot find a declaration of 2.1 in the platform bom so I'm confused about how to proceed. The documentation lists both of these as libraries provided by the platform, but the BOM doesn't provide any resolution between their conflicting versions. What is the recommended approach? Should I manually exclude 2.0 and explicitly declare 2.1 even if its not in the parent BOM? Should I force hibernate-entitymanager to use the 2.0 APIs?

I was hoping that the IO platform BOM would help me with these kinds of collisions.

  • Why not simply remove the 2.0 api from your list of dependencies? The hibernate version shipped supports JPA 2.1 so why ensist on using 2.0? – M. Deinum Jul 10 '14 at 08:26
  • I need the JPA API in my project source for `@Table`, `@Column`, etc, so I have to declare something that defines those. What the platform-bom import gives me is inconsistent with itself. I can, of course, override it, but I thought the point of the platform-bom was to avoid such things. – user3821274 Jul 10 '14 at 16:04
  • The hibernate-entitymanager already pulls in that dependency, leaving it out should give you the one that is included with the hibernate-entitymanager. – M. Deinum Jul 10 '14 at 17:58

0 Answers0