Sunday, February 26, 2012

Why I hate Maven

Yes, I admin that Maven has improved the development of Java programmers because the tons of dependencies each project brings.

So, why do I hate it so much? 

Thousands of network calls
One of the main reasons is because of the thousands of network calls to remote servers to

  • check versions
  • check md5
  • download pom files
  • download jar files
To keep the internal repositories up-to-date Maven has to check all the dependencies in the internal repository daily and each Maven user has to pay the latency cost of downloading a lot of files all the time. A workaround for this problem might be to install nexus or Jenkins on a server on the local network, but you still have the problem with latency on the internal network.

A workaround for me is to do 'mvn clean install' each morning, then go and fetch coffee...

Simple tasks is hard
Simple tasks as creating an executable jar or building a new version of an application should be a piece of cake, but it isn't. All this can be done by using a lot of plugins, but the major problem with these plugins is the lack of documentation. 

You are forced into creating a bunch of Maven modules
Separating your code into different modules is good programming practice, but I don't like separating it because the build tool requires it. Creating a simple Maven project often requires you to create 4 or 5 maven modules and that's just to much.

Repeatable builds
Do I really trust Maven to give me repeatable builds? No. I do not trust that downloading dependencies from the internet will give me the same versions of the file each time. A better solution would be to fetch all dependencies from a revision control system.

1 comment:

  1. I agree. I even hate it without knowing its benefits if any; because in order to start with it I should read tons of text. Further why I could not work with it on my local hard-drive; why I should deal with repositories. Why compiling a Maven project takes one hour? I hate it from the very first moment I knew about it.