Yes, there is Ant, Maven, Gradle, etc. but these are more dependency management. Why isn't there something more similar to npm, cpan, etc.? The closest thing I see is https://jpm4j.org/ but it seems to have slowed down.
It sucks, but it's probably because Java is used so much by large enterprises - and big organizations often won't tolerate using other people's code or sharing their code with other people. Node and Perl are used more by individuals (or startups) doing small bits and sharing back and forth.
Pretty much everything of the Java ecosystem is open source and I don't think there are organizations that wont use any open source code written by other people.
http://leiningen.org/ http://www.scala-sbt.org/