Maven: A project management solution for Java
Takeaway: Maven is a project management tool that takes Ant concepts several steps further. See why Maven's great features—including jar repositories and project site generation—make it an attractive project management solution for Java.
Nontrivial software projects need build tools. In the Java world, there's no shortage of these tools, with Ant being the standard.
Maven is another project management/build tool on the open source scene. Maven, which is compatible with Ant, is a project management tool that takes Ant concepts several steps further. Maven isn't built on top of Ant, but it can take advantage of, and even generate, Ant build scripts.
In order to use Maven, you must first create a Project Object Model (POM). The default POM is the project.xml file. The POM describes your application and its dependencies. Maven uses the POM to build your project and related documentation. Once you have a basic project.xml file, you can use it as a template for all of your projects.
Maven has goals, which are roughly analogous to Ant's targets. Maven also has many useful predefined goals for compiling, deploying, generating documentation, generating Ant build scripts, and creating jars, wars, ears, etc. It's all built right in. And if there's something missing, you can build your own plug-ins without too much effort.
Two of Maven's coolest features are jar repositories and project site generation. Jar repositories are local or remote sites that contain jar files. When you document a jar dependency in your POM at build time, Maven will automatically download the necessary version of the jar into its local repository. This feature can make building your projects less painful. The project site generation goal creates a professional Web site of your project, including links to syntax highlighted source code, code metrics, javadoc, unit test results, and more.
One common (and valid) complaint about Maven is that sometimes it's slow. Some developers have resorted to using Maven to create an Ant file that they use for daily development, and then use Maven to distribute their projects or as part of a nightly build process.
In any case, the features that Maven provides make it deserving of at least a serious evaluation.
Delivered each Thursday, our free Java newsletter provides insight and hands-on tips you need to unlock the full potential of this programming language. Automatically sign up today!
SponsoredWhite Papers, Webcasts, and Downloads
- Eleven Myths about 802.11 Wi-Fi Networks Global Knowledge
- WPA2 Security: Choosing the Right WLAN Authentication Method for Homes and Enterprises Global Knowledge
- How Does Ping Really Work? Global Knowledge
- Ten Ways Hackers Breach Security Global Knowledge
- User's Guide to Office 2007: No Need To Wait, Deploy It Now Global Knowledge
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET

