I'm trying to understand what the purpose of Maven is. Maven's site says that it is used for building projects. But if I can already build Java projects in Eclipse, why do I need Maven? What does Maven offer that Eclipse doesn't already have built in? The reason why I migrated away from development under Microsoft technologies because it became bloatware. I really have no intention on adding more complexity to my Java/Eclipse development cycle than what is necessary. Those days should be long over. As critical as I am of Microsoft's technologies, their RAD is second to none. Still, I'd be interested in knowing whether pursuing Maven can be justified. I'd rather invest my precious time learning new APIs or stuff that contributes to the actual product than wasting time with something that only slows down the process.
3 Answers
When you are developing in a industrial environment it's really import to manage your project dependencies. Every member of the team should use the same set of libraries and the same versions of the dependency libraries otherwise it will cause some unpredicted errors in the project.
This is one of the main advantage in using Maven.
IF you are using Continuous Integration Tools like Hudson,Jenkin etc You can configure automatic builds in your projects.
When doing Maven build we can define several build goals this will give you more flexibility.
Comments
Maven is no just a "build tool", it's a build platform which takes care of building, organizing projects from a technical point of view and dependency management. It follows the priciple "Convention over Configuration". That means that your projects are some kind of "standardized", so it's guaranteed that everybody who checks out the project, has the same libraries, same structure, and so on. Maven does all its work by plugins. There are lots of plugins for the different kinds of work.
Another advantage is the version management. If you build projects in Eclipse, you can't create different versions of projects which is essential for professional development. How would you supply a version of a project without a version management? What happens when you or your customer needs a fallback version of your projects. With a build platform like Maven you can handle all this. I can't imagine how you can work professionally without a build platform.
Probably one of the best advantage is the dependency management. You don't have to copy libraries manually anymore. Maven takes care about all this. You just have to configure your dependencies on pom.xml ("Project Object Model")
On Android Maven can handle all steps, deploying, starting on device, packaging, zipaligning, and so on. None of if needs to do manually anymore.
Maven is so extensive that you can't explain it in few words. Maybe you should read on the of open books of Sonatype.
2 Comments
One of the features of Maven that I find very useful is its ability to add library dependencies from a centralized repository. If I wanted to use Spring, in Eclipse without Maven I would need to find all of the necessary jar files, determine their dependencies download them and place them on my classpath.
With Maven, I simple query the central repository, select the artifact I would like and then watch as it pulls in the artifacts dependencies.