gpt4 book ai didi

maven-2 - mvn 全新安装、部署、发布

转载 作者:行者123 更新时间:2023-12-03 04:36:23 32 4
gpt4 key购买 nike

我刚刚学习maven,最近需要走的越来越多。我想知道两者的区别

mvn 全新安装

mvn 发布

mvn 部署

请尽可能具有描述性。

最佳答案

cleaninstalldeploy 阶段有效 lifecycle phases调用它们将触发它们之前的所有阶段,以及与这些阶段绑定(bind)的目标。

mvn clean install

此命令依次调用clean 阶段和install 阶段:

  • clean:删除项目目录中构建时生成的文件(默认为target)
  • 安装:将包安装到本地存储库中,以用作本地其他项目的依赖项

mvn deploy

此命令调用部署阶段:

  • 部署:将最终包复制到远程存储库,以便与其他开发人员和项目共享

mvn release

这不是一个有效的阶段,也不是一个目标,所以这不会做任何事情。但如果指的是Maven Release Plugin用于自动化发布管理。发布项目分两步完成:准备执行。据记录:

Preparing a release goes through the following release phases:

  • Check that there are no uncommitted changes in the sources
  • Check that there are no SNAPSHOT dependencies
  • Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
  • Transform the SCM information in the POM to include the final destination of the tag
  • Run the project tests against the modified POMs to confirm everything is in working order
  • Commit the modified POMs
  • Tag the code in the SCM with a version name (this will be prompted for)
  • Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
  • Commit the modified POMs

然后:

Performing a release runs the following release phases:

  • Checkout from an SCM URL with optional tag
  • Run the predefined Maven goals to release the project (by default, deploy site-deploy)

另请参阅

关于maven-2 - mvn 全新安装、部署、发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3660759/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com