Wednesday, February 3, 2010

maven quirks

Things that are problematic with maven:

dependency management
correctly configured maven offers to automagically handles the dependency management of your project - after defining your projects dependencies maven will fetch them from the repository (internet) and install them in your local repository.
So far so good - the dependencies themselves usually also have dependencies and maven will fetch all of them for you.
The problems start when there dependency conflicts or references to direct implementations of e.g. loggers etc. Sometimes libraries depend on a different build of dependencies - like 1.5 builds vs 1.6 builds or a nodeps build vs a build with several smaller jar files.
To resolve that I specified exclusions and specific version imports for the dependencies in question. Netbeans offers a nice dependency viewer which even offers to view and resolve conflicts with just a mouseclick.

memory
as maven usually starts quite many task directly from the same java vm (there are exceptions which fork the java vm) you may have to be careful to offer maven enough java heap space for the build.
It is the same for ant but it should be mentioned.
(This of course depends on the size of the project)

No comments:

Post a Comment