Is there a package manager for Java like easy_install for Python ?
I'm looking for a solution usable from the command line and not from an IDE.
Java has two main options for package management, Maven is the industry standard. Maven Central Repository is an online repository containing a vast array of packages available for use in your projects.
Pip: The Standard Package Manager Pip is built-in to Python, and can install packages from many different sources. But PyPI.org is the primary and default package source used. By default, pip installs packages onto a project's global Python environment resulting in packages being accessible by all projects.
A package manager keeps track of what software is installed on your computer, and allows you to easily install new software, upgrade software to newer versions, or remove software that you previously installed.
Maven does provide dependency management based on remote repositories (like the central repo) that are browsable, searchable.
Maven Ant Tasks (retired) use Maven's repositories to provide dependency management and more to Ant builds.
Ant Ivy is another alternative to Maven Ant Tasks.
MOP is another command line tool that leverages Maven's repository and dependencies.
Edit 2017-04-27: I have been disappointed by the lack of forward momentum for jpm4j, and the lack of community-centric development. So I invented a new tool called jrun. I invite everyone to check it out. It has a narrower scope than tools like Python's pip
, but it does let you execute Java code from remote Maven repositories in an easy-to-use manner.
Check out JPM4J. It is a project by Peter Kriens (of BND fame). He first proposed it last year, and as of this writing it has been around for a few months and is looking pretty impressive.
It was inspired by Node's npm, and like that tool, installation is a cinch:
OS X:
local $ curl http://www.jpm4j.org/install/local | sh global $ curl http://www.jpm4j.org/install/global | sudo sh
Linux:
curl http://www.jpm4j.org/install/script | sh
And Windows has a clicky installer, of course.
Then you install stuff similarly to other command-line package manager tools. E.g.:
jpm install org.codehaus.groovy:groovy-all
The install command operates Maven coordinates. Basically, the JAR just needs a JPM-Command
entry in its manifest, and jpm
knows how to expose its main class as a command-line executable.
Personally I would really love to see the Java community get behind an effort like this. A really solid Java package manager is years overdue!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With