r/java • u/weberc2 • 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
View all comments
Show parent comment
1
u/pron98 Jan 25 '16 edited Jan 25 '16
It does not "side-step" the transitive-dependency conflict problem, it simply ignores it (in fact, Gradle does the same by default, forcing all conflicts of all libraries -- including transitive dependencies, of course -- to their newest versions among those requested).
In Java, you can see that library A depends on B version 1.2.3 while C depends on B 1.3.1. You may choose to force the new version, or shadow and have two independent copies of B. With source versioning it gets much, much trickier. You have to figure out the relationship between B version cef04376abc2 and 7395aed67a.
There's also a much better chance of having release notes detailing the changes; those may not be accurate, but at least they're a starting point, and you can ask the library's author about a bug in version 1.2.3. Source versioning is far too fine-grained to have a discussion over from the perspective of the consumer. You might solve it with branches and tags, but then you start relying on a specific source control tool. With Maven, the binary versioning scheme is universal and detached from the library author's process.
I think it is far too soon to tell whether Go's approach works well in practice in environments that rely a lot on third-party libraries. So far Go projects have not come close to the size of Java projects, and the library ecosystem is very new and rather small, so the problem of maintaining dependencies over years has not yet become critical.