Java Build Tools: Ant vs. Maven [closed]

It really depends.
Maven and Ant are just different approaches: imperative and declarative (see Imperative vs Declarative build systems)

Maven is better for managing dependencies (but Ant is ok with them too, if you use Ant+Ivy) and build artefacts. The main benefit from maven – its lifecycle. You can just add specific actions on correct phase, which seems pretty logical: just launch you integration tests on integration-test phase for example. Also, there are many existing plugins, which can could almost everything. Maven archetype is powerful feature, which allows you to quickly create project.

Ant is better for controlling of build process. Before your very first build you have to write you build.xml. If your build process is very specific, you have to create complicated scripts. For long-term projects support of ant-scripts could become really painful: scripts become too complicated, people, who’s written them, could leave project, etc.

Both of them use xml, which could become too big in big long-term projects.

Anyway, you shoud read specific documentation on both. Also, there is ant-maven-plugin, which allow to launch ant-scripts with maven.

P.S. You can take a look on Gradle, which for me could provide more freedom than Maven, but is easier to use than Ant.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)