Many people see Apache Maven as a build and dependency management tool. I see its strengths in other areas. Recently we had an in-house discussion about maven and I want to present my views here:
- Maven standardizes your project layout and thus lowers the entry barrier for other developers.
- Maven provides a IDE/tool agnostic way of describing a project and infrastructure to work with it. You get things like build and launch targets for free, depending on the archetype.
- Archetypes (templates) for new projects make getting up to speed faster and easier.
- Integration in many tools like continuous integration servers or IDEs is very good, so not much configuration work has to be done to get your project under test and supervision of analysis tools.
- Ready-to-use plugins for many tasks.
- Usable software distribution model helping in distibuted environments.
- Big, ugly xml-specification (maven2, still need to check out the groovy and scala DSLs for poms) of the project.
- Lacking documentation in some areas, e.g. certain plugins and best practices.
- Once in a while “downloading the internet”-effect and auto-magic you need cope with.
- Does not really solve dependency problems the way many people expect it.
So while you certainly can implement all wanted features of maven with other build and scripting systems and setup nice self-contained projects using maven can help you depending on your scenario. You have to know the strengths and weaknesses of your tools and try to decide accordingly. My experience is that you can get a basic project up and running in a healthy state very fast with maven. As the project grows the complexity will too and may outweigh the initial benefits. All tools require that you understand and use them well or they will stand in your way more and more. Especially using maven makes only sense if you adopt its style and conventions. If you strongly disagree there you will be happier with some solution like ant, cmake, gradle, ivy, make, sbt or the like providing more freedom by leaving more descisions up to you.
We are using different build and project description tools depending on the environment, involved technologies and project size and scope. Often this decision will not or cannot be changed so try to make a sensible decision considering all available information at hand.
6 thoughts on “Different view on Apache Maven”
Java is fast to compile. Hopefully, maven solved this problem !
Great software anyway, but your cons are very real, and maven should improve on this.
Maven has only one serious problem – non-unit tests support. Try to add integration, functional, ui-tests to your build configuration and you will see it.
Armen, you’ll find plugin to run unittest when compiling with maven. I use it at work.
Armen is talking about *non*-unit tests. Unit testing works out-of-the-box indeed.
true. There is no problem with unittests, but what if you want to run other types of tests, especially tests which require already built and deployed war file or run selenium server. Yes it is possible with mavevn, but it looks ugly and non user-friendly and requires painful and time consuming configuration procedure.
Great list of Pros and Cons there! For people who might need info how to set up Maven, we’ve written a very detailed article about it here — http://www.ideyatech.com/2012/07/setting-up-maven/