I was wondering why suddenly there was increased interest in using
Maven. Threads are started in
PinoyJUG about it. I'm glad it's gaining ground in our local scene.
I started using this tool a few years back when I had to build one of Apache's projects. I just can't remember what project that was. I think that was 3 years ago. I am using it for my open source project
LemonSMS.
Anyway, Maven is a tool for building Java projects. It has features like:
- Auto-dependency checking and updating of libraries required by your project
- Automatic generation of documentation in PDF and html
- Automatic generation of your project website
- Continuous integration support
- Multiple project support
- Plus other features you will discover when using it
Official set of features can be seen
here.
The auto-dependency checking feature is interesting.It allows you to define the dependency libraries in your project's configuration. The feature is similar to BSD and Gentoo's ports system. With this feature, you avoid the trouble of downloading the right version of the library your project requires because versions are defined in the configuration as well. This is very useful for medium-to-large sized teams especially if your working on reusable components.
Let's have one scenario. Let's say I am responsible for creating and updating the database access components in my team. My component is being used by different projects that require database functionalty. The ordinary process will be to compile the component into a jar then give copies to other members of the team. Pretty straightforward eh? Yes, it's easy if you have a small team. However, let's say we have 12 team members. So what's the issue? I can still give copies to the other 11 members right? You're correct.
Here's the thing. Let's say I need to update a method in the library and this is affecting all modules coded by the other team members. What I'll do is build the library and have the others use it. But there's this one junior guy who for some reason mixed up copying the correct version to his machine. Now, he can't compile! So he goes to your desk and asks what seems to be the problem. He insists that he copied the correct version. Now you go to your desk and resend your library. It seems that you sent the wrong version. Now, you have to notify the other team members. Isn't that a pain?! How much time was lost? So this is the problem Maven is solving with this feature. It avoids your team to mix up versions of the libraries because the source is central and checking is done on-the-fly.
Another very neat feature of Maven is to automatically create PDF and html documentation. But this is nothing. What's really cool is you can create your project website automatically by just one command. Did you see Maven's website? This was automatically generated using Maven. Don't believe me? Check out all project websites in
Apache Jakarta that uses Maven. You'll see the similarity. ;-)
Maven is a pain when you're starting with it but when you get used to it it's a pretty useful tool. Maybe you can start with
Maven's 5 minute tutorial and get the feel of it.
Happy Coding!
Posted
03-13-2007 9:44 PM
by
javazealot