May 22nd, 2008, 01:44 AM
A way towards Maven clean dependencies...
As I was trying to upgrade to webflow 2.0.1 using Maven dependency system, I finally ran across (and it wasn't easy) this post: http://forum.springframework.org/showthread.php?t=53933
Any Maven user please read it as it's gonna be very helpful to manage your Spring dependencies in the future.
Any Spring submodule come with a bunch of dependencies that Maven optimizer won't be able to process if you include the spring.jar dependency in your pom. As stated somewhere, it's best to fine tune your dependencies and not use the complete Spring suite as contained in the spring.jar.
Since I was not happy with the dependency mess created by webflow and acegi-1.0.7, I decided to rewrite my dependencies to keep only the one i really needed. And when you consider in how many jars is the main spring.jar divided, that's quite a work! (btw, mvn dependency:tree and mvn dependency:analyse are 2 very good friends in this perilous operation)
In the process, I realized that spring-dao (2.0.8) is part of spring-tx(2.5.4). This is a little bit confusing as for the version.
So if you want to use only spring-tx and, for instance, spring-jpa, the latter will add a dependency on spring-dao, Maven not being able to know you already have spring-dao in your classpath.
So I end up in addding an <exclusions> list in my dependencies, which I just wanted to avoid in starting the whole operation. Or I can have a dependence on spring-tx-2.5.4 and spring-dao-2.0.8, hoping the dao part is the same despite version difference.
Anyways, by the time Maven get smarter, it'd be very very helpful to have this information: which jar in the suite contains the class I depend on. (I don't know of any thing like this, please be kind and point it to me if it does exist).
Any other solution or help in this painful quest for the right dependencies is welcome!
Last edited by Jean; May 22nd, 2008 at 02:04 AM.