Tonight I’ve fought with making Maven and Hibernate to cooperate… After 1,5h struggle, I’ve decided to write down what I’ve “discovered”.
- When adding dependencies to your persist module you should avoid adding the
hibernate
package dependency itself as there should be onlyhibernate-annotations
one. - When adding
log4j
dependency remember that version 1.2.15 is messed up and forces you to download jars from SUN webpages if you want to get rid of those nasty dependency errors that maven throw in your face… Instead of 1.2.15 choose 1.2.14 as it’s dependencies are not optional and Maven will successfully download all of them. - When adding
slf4j
(Simple Logging Factory For Java) remember that when you addslf4j-log4j12
package it comes with depended packageslf4j-api
but the versions might (and are!) non-compatible… In my caseslf4j-log4j12
v. 1.5.6 came withslf4j-api
v. 1.4.2. You should excludeslf4j-api
dependency fromslf4j-log4j12
and add it separately in the same version asslf4j-log4j12
(in this case 1.5.6).