gstackoverflow
gstackoverflow

Reputation: 36984

Many jars libraries version compatibiity

For example I have the following hibernate stuff in my pom.xml:

<!-- Hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.6.10.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.3.1.GA</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>4.0.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.2.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-envers</artifactId>
            <version>3.6.10.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.6.10.Final</version>
        </dependency>

Now it is working good. But at the moment I need to change version of hibernate core to 5. I am afraid affection of my change. As I understand it is rarity if library has back compatibility. But after changing major version it is absolutely impossible.

How can I determine respective versions of remain hibernate stuff ?

Upvotes: 0

Views: 782

Answers (2)

anish
anish

Reputation: 492

Maven Bill of materials (BOM) provides such a feature where we can include the artifacts which we need, however the versions need not be explicitly defined and the versions would be referred from the bom file which would help maintain the latest versions of the defined artifacts. More details and examples are provided at this link: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

Another with a JBoss example which I found: http://www.mastertheboss.com/jboss-frameworks/maven-tutorials/jboss-maven/maven-and-jboss-how-to-use-boms

Upvotes: 0

mystarrocks
mystarrocks

Reputation: 4088

Usually the team (Hibernate in this case) should provide a compatibility matrix of its various libraries.

Even if they don't, it's generally not that difficult to determine that yourself. The latest versions of all the libraries should generally be compatible, so if you intend to upgrade everything to the latest, the upgrade is likely to go smooth.

In your case, hibernate-core, hibernate-envers and hibernate-entitymanager appear to follow the same version nos., so you could use 5.0.0.Beta2 for these libs. Just use the latest versions of the rest of the libraries (almost all of them look like utilities, so I'd expect them to be compatible with the core libs above).

You're going to have to try the combinations to see which one works. In these cases, having a strong set of test suites in place usually helps.

Upvotes: 1

Related Questions