Hacker News new | ask | show | jobs
by reitanqild 3831 days ago
> It feels like half the time I download a Java/Maven project, there is some issue with the build that I have to spend time debugging. I'm not familiar with Maven, and Maven is pretty complicated, so this is a pain.

Maven actually simplifies a lot and luckily has been kind of the standard on Java for the last few years.

For simple projects, as long as you have a working jvm and mvn on the path it is just a matter of mvn build. Also IDEs, at least IntelliJ and NetBeans tends to understand pom natively.

For more complicated projects my gut feeling is they would have been even more complicated without maven.

1 comments

It may be standard for Java, but I wouldn't say it's simple. I'll give you an example.

Say I want to use protobufs. There are a couple prerequisites: 1) I have to know the protobuf syntax. 2) I have to know how to compile the protobuf file into my language of choice.

If you're using maven, you also have to know which plugin to use (a simple google search), and add the 30 lines of XML to your build file. This is not such a big deal, except you're also hoping that the plugin supports all the protoc features that you may need. And what versions of protoc does the plugin work with? And is the plugin well documented?

Compare this to using make, or even using the <exec> ant task. protoc is well documented and you can access all the features you want in a standard way (command line options and arguments).

Aren't you oversimplifying a bit on the non-maven side?

Last I checked when I use make I still have to find and download all dependencies before I can get a working build.

Maven sorts all that.

Fair point. But I'd say the dependency management in maven is actually more of a hassle than it's worth. For me, I understand jars in a lib directory well enough. Dependency management can become complicated pretty fast (e.g. version resolution).
You still need version resolution for jars in a lib directory, whether Maven does it or you do it.

Maven just automates the process.

I guess I never found manual dependency resolution to be that big of a problem.
I've never found automatic dependency resolution to be that big of a problem.

But if I had, I'm sure that manual resolution wouldn't have been any easier or more maintainable.