是否有适用于 Java 的软件包管理器,例如适用于 Python 的 easy_install?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2710266/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 11:07:53  来源:igfitidea点击:

Is there a package manager for Java like easy_install for Python?

javapackage-managers

提问by systempuntoout

Is there a package managerfor Java like easy_installfor Python ?
I'm looking for a solution usable from the command line and not from an IDE.

是否有适用于 Java的软件包管理器,例如适用于 Python 的easy_install
我正在寻找可从命令行而不是 IDE 使用的解决方案。

采纳答案by Pascal Thivent

Mavendoes provide dependency managementbased on remote repositories(like the central repo) that are browsable, searchable.

Maven确实提供了基于可浏览、可搜索的远程存储库(如中央存储库)的依赖项管理

Maven Ant Tasks(retired)use Maven's repositories to provide dependency management and more to Ant builds.

Maven Ant Tasks (已停用)使用 Maven 的存储库为 Ant 构建提供依赖项管理和更多功能。

Ant Ivyis another alternative to Maven Ant Tasks.

Ant Ivy是 Maven Ant Tasks 的另一种替代方案。

MOPis another command line tool that leverages Maven's repository and dependencies.

MOP是另一个利用 Maven 的存储库和依赖项的命令行工具。

回答by sblom

Ivy from Apacheis the closest thing I know of.

来自 Apache 的 Ivy是我所知道的最接近的东西。

回答by ctrueden

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.

编辑 2017-04-27:我对 jpm4j 缺乏前进动力以及缺乏以社区为中心的发展感到失望。所以我发明了一个名为jrun的新工具。我邀请大家来看看。它的范围比 Python 之类的工具更窄pip,但它确实让您以易于使用的方式从远程 Maven 存储库执行 Java 代码。



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.

查看JPM4J。这是Peter Kriens(以 BND 闻名)的一个项目。他于去年首次提出它,截至撰写本文时,它已经存在了几个月,看起来非常令人印象深刻。

It was inspired by Node's npm, and like that tool, installation is a cinch:

它的灵感来自于 Node 的 npm,和那个工具一样,安装很简单:

OS X:

操作系统:

local   $ curl http://www.jpm4j.org/install/local  | sh
global  $ curl http://www.jpm4j.org/install/global | sudo sh

Linux:

Linux:

curl http://www.jpm4j.org/install/script | sh

And Windows has a clicky installer, of course.

当然,Windows 有一个点击式安装程序。

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-Commandentry in its manifest, and jpmknows how to expose its main class as a command-line executable.

install 命令操作 Maven 坐标。基本上,JAR 只需要JPM-Command在其清单中添加一个条目,并且jpm知道如何将其主类公开为命令行可执行文件。

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!

就我个人而言,我真的很想看到 Java 社区支持这样的努力。一个真正可靠的 Java 包管理器已经过期多年了!