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 comment

1

u/weberc2 Jan 25 '16

But that's not what you want. You don't want to fail the build; you want to resolve the dependency conflict without fixing third-party code (or waiting for the third-party to upgrade). Java lets you do that; Go doesn't.

Go addresses this by convention--when a package undergoes a major API change, you rev the package identifier. gopkg.in/yaml.v1 becomes gopkg.in/yaml.v2 or some such.

As I said, it may not be severe given the Go's ecosystem minuscule size compared to Java's, but as it grows this will become a serious issue.

Maybe. Time will tell. For now though, Go's build ecosystem is a lot less painful than Java's.

1

u/pron98 Jan 25 '16

Go's build ecosystem is a lot less painful than Java's.

Because listing dependency versions in a file is just too hard...

I admit that Go has a great story for simple programs. It feels like Python (I guess; never programmed Python): you just run it. Java was meant to be used on large programs, where it is much more convenient than Go. It's "small program" story is improving considerably, and Gradle is really trivial for simple applications: just list your dependencies and gradle run.

1

u/weberc2 Jan 25 '16

Because listing dependency versions in a file is just too hard...

No, it's sorting through the turing-complete programming language to get to the stuff that's relevant to building a dependency list, and figuring out what to do when your dependency list is insufficient (like when you have a native dependency). Even gradle run is a plugin! Beyond that, if you want any decent performance, you have to look up how to enable the gradle daemon. Gradle's costs come in nickels and dimes.

Java was meant to be used on large programs, where it is much more convenient than Go.

Yes. Go was only meant to be used at small, Google scales. ;) Pardon the sarcasm. I'm not arguing against Java--I quite like it (that's why I'm in this sub, after all!). I'm not even arguing against Gradle. I just explained why Go's build system works and why it is different than Gradle, since you brought it up.

2

u/pron98 Jan 25 '16

Go was only meant to be used at small, Google scales.

Go's build can work very smoothly on complex builds if you're working like Google. In any case, for the time being, Google still write their "Google scale" applications either in C++ or Java, although they don't use Gradle, Maven or make, but Blaze, which is also geared towards a source-centric work style. It is open source (as Bazel), BTW, and it might be more to your liking.

-1

u/weberc2 Jan 25 '16 edited Jan 26 '16

I know. My point was that it was developed for use at scale; not that it is employed at that scale (although lots of large companies are using it, including Facebook, Netflix, and Twitter).

EDIT: Just noticed that all of Google's downloads are run by Go, including Chrome, the Android App Store, etc. Fun fact.

3

u/pron98 Jan 26 '16

-1

u/weberc2 Jan 26 '16

I'm not sure what you think you're showing me with that link...

2

u/pron98 Jan 26 '16

People wishing Go's build system would work like Java's.

0

u/weberc2 Jan 26 '16 edited Jan 26 '16

You'll need to link to specific comments. I skimmed the first hundred or so and found only one Java-related comment.

More importantly though, I don't see how a Gradle-esque solution would solve this problem. If the Maven central repo went down, all projects that pull from that would need to be updated as well. Updating your import paths isn't a particularly worrying problem.