mvn:deploy 和 mvn:install 命令有什么区别?

发布于 2024-12-06 07:41:35 字数 30 浏览 0 评论 0原文

我认为应该有一些区别,但有人可以告诉我细节吗?

I think there should be some difference, but can anyone tell me the details?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

扮仙女 2024-12-13 07:41:35

mvn:install 将打包的 Maven 模块复制到本地存储库(默认情况下位于 ~/.m2/repository 中),以供其他本地 Maven 构建访问。

mvn:deploy 将打包的 Maven 模块上传到另一个(通常是远程)存储库,以供其他(不一定是本地)Maven 构建访问。

有关详细信息,请参阅构建生命周期文档

mvn:install copies your packaged Maven module to your local repository (by default, in ~/.m2/repository), to be accessed by other local Maven builds.

mvn:deploy uploads your packaged Maven module to another (usually remote) repository, to be accessed by other, not necessarily local, Maven builds.

See the documentation for the build lifecycle for more info.

浮生未歇 2024-12-13 07:41:35

install 阶段负责将工件安装到本地缓存存储库中。这基本上适用于 Maven 存储库,但一个众所周知的例子也是 maven-bundle-plugin 支持的 OSGi Bundle Repository。

deploy 阶段负责将工件安装到已发布存储库中。这通常适用于远程存储库,但也可以完全是暴露给外界的本地存储库。

与所有 Maven 阶段一样,您可以用它们做任何您想做的事情。您可以根据需要调整插件阶段,但上述语义是常规语义,您应该坚持使用它,以便与其他插件目标的默认阶段保持一致。

The install phase is responsible for the installation of artifacts into local caching repositories. This basically applies to the Maven repository, but a well-known example is also the OSGi Bundle Repository supported by maven-bundle-plugin.

The deploy phase is responsible for the installation of artifacts into published repositories. This usually applies to remote repositories, but is could perfectly be a local repository exposed to the outside world.

As all Maven phases, you can do with them anything you want. You can shuffle plugin phases as you see fit, but the above semantics is the conventional one and you should stick to it in order to be consistent with the default phases of other plugins' goals.

哀由 2024-12-13 07:41:35

mvn:deploy 执行到远程存储库/环境的部署,mvn:install 将所有已编译的包安装到本地存储库,使它们可用于在本地计算机上执行的其他构建。

mvn:deploy performs deployment to remote reposiory/environment, mvn:install installs all compiled packages to a local repository making them available to other builds performed on the local machine.

他夏了夏天 2024-12-13 07:41:35

一言以蔽之:mvn:install将您的组件编译并安装到本地Maven存储库中,以便您在本地使用和开发的其他组件依赖于它时可以使用它。 mvn:deploy 将您的(之前安装的)组件部署到远程存储库。

In one sentence: mvn:install compiles and installs your component in your local Maven repository, so that you can use it when other components used and developed locally depend on it. mvn:deploy deploys your (previously installed) component to a remote repository.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文