mvn:deploy 和 mvn:install 命令有什么区别?
我认为应该有一些区别,但有人可以告诉我细节吗?
I think there should be some difference, but can anyone tell me the details?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我认为应该有一些区别,但有人可以告诉我细节吗?
I think there should be some difference, but can anyone tell me the details?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
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.
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.
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.一言以蔽之:
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.