March 28, 2016

How to Find Java Artifacts

Recently, I've done a fair amount of work in java and its insanely huge class library. Like a TV sales pitch, but wait, there's more. However, given that this was never intended to be used by the world outside of academia and was, the good lords granted us a build system to alleviate long commands typed again and again. In keeping with its verbose design goals, every jar your project uses must be listed on its classpath, which became unwieldy, impractical and annoying. The solution to this were dependency management systems, like maven, ivy, gradle, or sbt.

But, while that solved the problem of compiling the project, it did not solve the problem completely. The good Java developers then came up with the concept of the fat jar, a jar with all dependencies included. And, again, every build tool had its own method (or methods) of achieving this. Ivy's is the most transparent, while maven hides the same thing in its shade plugin, which bolts itself onto the package, so as to try to be transparent. Gradle is similar to ivy in that there's a requirement of a custom task. And sbt also has an assembly plugin.

This is a mere outline of the state of java development infrastructure, circa Q1 2016. We are currently using all of these approaches in different projects, all of which are still supported. When I want to add, say, a better date handling class, how do I remember the specific syntax for the specific build tool? I could use go through links to figure it out, or I could use units to find it and copy the correct syntax for the build system straight into the build file and have it work once and for all time.

No comments:

Post a Comment