Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are your impressions of Maven? [closed]

Tags:

I am considering using Maven for a Java open source project I manage.

In the past, however, Maven has not always had the best reputation. What are your impressions of Maven, at this time?

like image 484
Julien Chastang Avatar asked Nov 19 '08 23:11

Julien Chastang


People also ask

What is the main purpose of Maven?

Maven's primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal, Maven deals with several areas of concern: Making the build process easy. Providing a uniform build system.

What is Maven and how it is helpful to the project What are the advantages of using Maven?

Maven is a project management and comprehension tool that provides developers a complete build life-cycle framework. Development team can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build life-cycle.


4 Answers

For an open-source project, Maven has some advantages, especially for your contributors (eg mvn eclipse:eclipse).

If you do go with Maven, the one rule you must follow religiously is: don't fight the tool. Layout your project exactly how Maven recommends, follow all its conventions and best practices. Every little fight you get into with Maven is a day you won't be spending writing code for your project.

Also consider up front where you want to deploy your artifacts (are you going to host your own repository?).

And don't be afraid to go with something other than Maven (eg Ant). The success of your project will be the project itself, not its build tool (so long as you choose a best-of-breed build tool, which both Ant and Maven are).

like image 130
Matt Quail Avatar answered Oct 01 '22 05:10

Matt Quail


Personally, I'm not a fan. I agree with most of what Charles Miller says about it being broken by design. It does solve some problems, but it also introduces others.

Ant is far from perfect, but it is a lot more robust and far better documented. It does take some discipline to use it in a modular way though (which is one of the things Maven is trying to address). I think that inventing something better than both Ant and Maven wouldn't be that difficult, but that tool doesn't seem to exist yet.

If you like Maven's dependency management but not Maven, you can get something similar in Ant using Ivy. My problem with this style of dependency management is that is fragile due to factors outside of your control. The one use case where it does make some sense is if you have lots of projects internal to your organisation that depend on each other. In this case everything is under your control and it might work quite well.

EDIT: I forgot to add that even if you don't like Maven, you can't ignore it. If you write open source libraries that other people use, they will expect them to be available in a Maven repository so that they can use them easily from their Maven builds.

EDIT2: Since you've clarified that your main interest is in providing an Open Source library to other Maven users, it's worth noting that you don't necessarily have to use Maven to achieve this. There is a set of Ant Tasks for publishing to a Maven repository. So, if you want to continue using Ant to build your project, you can do but still satisfy your Maven-using users.

like image 36
Dan Dyer Avatar answered Oct 01 '22 04:10

Dan Dyer


If your project is 'simple', then maven lets you get up and running quite quickly. By simple I mean you have a bunch of code, some resources, some test classes and it all goes together with some 3rd party jars to make an application.

The moment you want to do something unusual that is in some way specific to your own project then you will end up spending all your time trying to make maven do what you want it to and none of your time working on your code. This for me defeats the purpose of using a clever build system.

Maven is also dreadful for helping you diagnose problems when it's not working. And the build scripts are unreadable screeds of unintuitive and unnatural xml, which may of course be what you prefer and are looking for (If you have ant-vision).

I love maven. Maven is full of goodness and promise. I also hate maven.

Edit:

Oh, and the maven plugin for eclipse is flippin' brilliant.

like image 26
izb Avatar answered Oct 01 '22 04:10

izb


I had the misfortune of working with Maven when it was transitioning from 1.x to 2.x. It pretty much consumed 100% of the time of one of our more senior team members. We eventually scrapped it.

However, more recently I had a chance to revisit maven, and I would say it has improved. One of my main issues has been the lack of good documentation, but after reading "Maven: the definitive guide", I would say its much easier to fathom.

Along with the m2eclipse plugin for eclipse, managing dependencies becomes a doddle - it has an excellent dependency visualisation tool.

Overall, I would say Maven is a great tool starting out on a project, but may start to lose its way once your build begins to gain complexity.

like image 24
toolkit Avatar answered Oct 01 '22 05:10

toolkit