It allows you to use newer versions of libraries than defined by the dependent libraries (e.g., critical bug fixes), without having to modify any jars manually. Maven handles dependencies automatically, relying on libraries (they call them artifacts) to be publicly available, e.g., on Maven Central. However, this is a nightmare, if you need to update a single library, but all you have is a single, enormous jar. Handy if you only want to have a single jar. Whereas Ant scripts quite often create a fat jar, i.e., a jar that contains not only the project's code, but also the contain of libraries the code was compiled against. For this to work, Maven enforces a strict directory structure (though you can tweak that, if you need to). With Maven, you only specify dependent libraries, a compile and a jar plugin and maybe tweak the options a bit. In Ant, you tell it where to find Java classes for compilation, what libraries to compile against, where to put the compiled ones and then how to combine them into a jar. Though its configuration file, pom.xml is written in XML as well, Maven uses a different approach to the build process. But unlike Ant, it is a more high-level tool.
0 Comments
Leave a Reply. |