Do I have to include version information in the pom.xml like below? I just want to add envers - already included hibernate-core without version.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>5.2.9.Final</version> <!--this one-->
</dependency>
When I exclude version info, there is no valid jar file in my .m2 directory.
Just created unknown folder and unknown file inside it.
I already have 5.2.9.Final hibernate-core, but I just wonder I have to write down version number in my hibernate-envers dependency.
It really depends on what is influencing the hibernate-core
dependency's version. Is that coming from some parent pom or dependency management section?
My first suggestion is to determine what influences hibernate-core
. Once you know that, you should be able to make it influence hibernate-envers
.
That aside, I generally define a set of properties like:
<properties>
<hibernate.version>5.2.10.Final</hibernate.version>
</properties>
And then for each of my hibernate artifacts, I reuse that version so that the appropriately versioned bundles are used and I don't need to maintain updating that version information in multiple places.
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>${hibernate.version}</version>
</dependency>
</dependencies>