Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a package manager for Java like easy_install for Python? [closed]

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.

like image 298
systempuntoout Avatar asked Apr 25 '10 22:04

systempuntoout


People also ask

Is there a package manager for Java?

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.

What package managers does Python use?

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.

What does a package manager do?

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.


2 Answers

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.

like image 120
Pascal Thivent Avatar answered Sep 20 '22 12:09

Pascal Thivent


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!

like image 34
ctrueden Avatar answered Sep 23 '22 12:09

ctrueden