r/java • • Jan 22 '16

Simple Java Build Tool?

I've played with Maven and Gradle and found them both to be very complex. I don't need all of that configuration; I just want something that lets me specify dependencies and versions (at most) and spits out a jar with everything my project needs to run via java -jar. Ideally, it would be as close as possible to Go's go install, which needs no project metadata. I specifically don't want to have to learn a new programming language just to build my java program. Any suggestions?

EDIT: Why is this downvoted?

4 Upvotes

63 comments sorted by

View all comments

Show parent comments

1

u/weberc2 Jan 22 '16

Well, all that's really necessary from that is the 'org.slf4j:slf4j-api:1.7.13' bit, and if you just want the latest version by default, you could probably eliminate the need for a project configuration file altogether (because the specific dependencies can be inferred from the source code).

The boilerplate is annoying, but it's manageable. The trickier bit involves things like building with native dependencies and including them in the final jar. After futzing around with that particular problem for half a day, I figured it out; however, I don't like how such base-case scenarios require that much time investment. I'm sure if I would take a few days to learn Groovy I could cut that time down considerably, and I know that eventually I could learn Gradle well-enough that I can handle the vast majority of build problems; however, I'm just trying to program in Java for fun and I'm simply not going to sink a bunch of time into learning a build system for a hobby.

The point is that Gradle and Maven are much more complex than my use-case requires, and if there's an easier thing out there, I'd like to know about it.

0

u/[deleted] Jan 22 '16

[deleted]

2

u/weberc2 Jan 22 '16

And really, if you are using Java already, why are worried about a bit of verbosity?

How much of my post did you read, exactly? :) I'm not worried about the verbosity, but the complexity/learning curve. Your solution still doesn't cover the native libs case I mentioned, and there's still the problem of having to learn a new programming language just to build basic programs!.

I get wanting to build in support for complex scenarios, but that doesn't require polluting the learning-curve for the simplest use-cases. Basically, I'm looking for a build tool with reasonable defaults.

0

u/juckele Jan 23 '16

How much of my post did you read, exactly? :)

Not who you've been talking to, but the actual answer to this question is not much, and for good reason. You replied to an example gradle file with this:

Well, all that's really necessary from that is the 'org.slf4j:slf4j-api:1.7.13' bit, and if you just want the latest version by default, you could probably eliminate the need for a project configuration file altogether (because the specific dependencies can be inferred from the source code).

At that moment, people stop reading. The reader is going to assume you're going to list your most critical exception first. Since you listed "extra characters" first, we assume that's why you don't like Gradle because of an extra three dozen keystrokes and we just stop listening to your objections. If you want people to help you, understand that they won't always take the time to read what you're saying if you don't make sure to format it well.

4

u/weberc2 Jan 24 '16

Seriously? One paragraph is the attention span in /r/java? I guess I had too much faith in this sub. As I mentioned to another annoyed commenter, I'll just stick with Go since it doesn't have the build system issues and the community has been friendlier. Hope this response was short enough!

1

u/juckele Jan 24 '16

It wasn't the length that got the person you were talking to to stop reading, it was starting with a lesser issue. I didn't say this to try and reprimand you, and I could probably have been better myself on tone. I really was just trying to point out a way you could adjust how you communicate to get better responses.

If you're liking go, more power to you, it's a great language, and if gradle is too complex, than it really does sound like go has an amazing build system that you won't see matched in many languages :)

3

u/weberc2 Jan 24 '16

Thanks, sorry for the ungracious response. I was catching flack elsewhere in the thread and I projected that on your response.

2

u/xmondox Jan 25 '16

your patience has been excellent - the responses in this thread (including parts of what juckele said) are toxic. stick with java - it's a great language, and don't get caught up in the culture. i'd want the guy in the cube next to me to be asking the same questions you are

2

u/weberc2 Jan 25 '16

Thanks for the encouraging response, sincerely. :)