You’ve probably all heard of Maven and some of you are probably already using it. If not however, here’s a brief introduction into Maven and how to use it.
Maven is a project management build tool that helps maintain builds, documentation and other project artefacts, which we’ll not cover here. Maven describes itself as
an attempt to apply patterns to a project’s build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices.
That may sound a bit of a mouthful, but essentially it means that Maven is a best practice build and management tool.
So, why should we use Maven instead of Ant?
pom.xmlfile – the Project Object Model.
Downloading and installing Maven is a straightforward task. To install Maven you need to download it from the project site, unzip it to your hard drive and then set up two environment variables:
M2_HOMEmust point to the directory that you unzipped Maven into.
M2should be set to
%M2_HOME%/binand then added to your path.
mvn –versionfrom a command prompt. If all goes well, you should get the Maven version number returned to you.
~ > mvn --version Maven version: 2.0.9 Java version: 1.5.0_16 OS name: "mac os x" version: "10.4.11" arch: "i386" Family: "unix"
At Develop In Java, we've been a part of the Java community for over 10 years. If there's anything you'd like us to cover, just ask !