Before 2004 the defacto standard build tool for Java applications was ANT. It was a step up from the make-based way of building Java software; it featured standard tasks, like compile and jar, that you needed in most projects. It was a first attempt to make building java applications more declarative.
But as time moved on, and projects become ever more complex, so did the ANT scripts. You ended up with scripts calling scripts, calling scripts, calling scripts, … And soon building an application was just as complex as the average nuclear fission paper. Not even mentioning trying to assemble the right versions of all the dependencies into the libs folder.