Well the answer to this question depends on the individual perceptions. For majority of folks from development background, they consider Maven to be a Build Management Tool.
Ideally speaking Maven is much more capable of doing than a Build management activity and that is where few of them consider it to be also a Project Management tool.
Let me help you in understanding how Maven is considered to be both build management & project management tool. I am sure most of the hardcore Java developers would have worked on a well known build tool called ANT.
As we all know the sole purpose of ANT build tool is to perform certain pre-defined instructions / tasks written in a build.xml file which is inclusive of compiling the code, testing, packaging & distribution along with their pre-defined directory locations.
Well, Maven does all these and along with that Maven can also run reports, generate websites, communicate project related information to the team and which is why it is considered to be more than a build management tool.
Before getting in depth on Maven lets take a moment to get to know on the history of Maven.
History of Maven:
Maven was created by Jason van Zyl and it began as an attempt to simplify the build processes in the Jakarta Turbine project. Maven is built using a plugin-based architecture that allows it to make use of any application controllable through standard input. It addresses two aspects of building software: how software is built, and its dependencies.
Interesting facts:
The main plus point of Maven is having a defined life cycle with a set of common plugins which knows how to build the software.
Maven also comes up with a default project templates having a well defined project skeletal structure as shown below.
This further simplifies the developers work in terms for maintaining the uniformity across their projects and eases the process of developing the software.
In Maven projects, the dependencies, builds, artefacts are all described in an XML file called Project Object Model (POM.xml) which is similar to web.xml configuration file in a Java Web Application project.
Maven can be considered as a pretty dumb tool as it doesn’t know how to do much beyond parsing a few XML documents and keeping track of a lifecycle and a few plugins. Maven has been designed to delegate its tasks to Plugins.
Maven has plugins for everything from compiling Java code, to generating reports, to deploying to an application server. The Maven you download from Apache doesn’t know much about packaging a WAR file or running JUnit tests etc. Most of the intelligence of Maven is implemented in the plugins and the plugins are retrieved from the Maven Repository. In fact, the first time when you run the command like mvn install it retrieves most of the core Maven plugins from the Central Maven Repository.
In case if you need to add any 3rd party features / implementations to your projects then you can easily achieve it by getting the details from the Central Maven repository.
All you need to do is add those dependencies in the POM.xml file and you should be good to use it in your code. This is.. way more easier as compared to the earlier ways of implementing, where-in you would be downloading the 3rd party jars and placing it in lib or some external folders etc without any standard approach. There is always an overhead of sharing those additional jars along with the code with your peers. From that perspective, dependencies are well handled through Maven and all you need to take care of is just your code.
In my next article, I will be sharing more insights on the MAVEN life cycle & also on POM.xml file before we actually get into hands-on with Maven. So stay tuned..!! Until then happy learning.
No comments: