gpt4 book ai didi

maven-2 - Maven安装和部署

转载 作者:行者123 更新时间:2023-12-03 09:23:37 26 4
gpt4 key购买 nike

我对我们在CI服务器中的设置存有疑问。
用于构建应用程序的maven命令在Bamboo中配置为“mvn install deploy”

根据我的理解,这将调用“install” 的所有阶段,然后再次调用“deploy” 的所有阶段,这意味着并且正如我在日志中所看到的,应用程序被构建两次(两次)编译,两次测试)等。这也意味着应用程序所需的构建时间几乎是其两倍。

所需的只是“mvn deploy” 以正确构建应用程序。

我的理解/观察正确吗?

最佳答案

是的,您要做的就是查看执行生命周期。

  • validate - validate the project is correct and all necessary information is available
  • compile - compile the source code of the project
  • test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
  • package - take the compiled code and package it in its distributable format, such as a JAR.
  • integration-test - process and deploy the package if necessary into an environment where integration tests can be run
  • verify - run any checks to verify the package is valid and meets quality criteria
  • install - install the package into the local repository, for use as a dependency in other projects locally
  • deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.


在这里,您可以看到安装是在部署之前进行的。重要的是要知道,当您运行部署时,maven将运行所有其他阶段,然后说出目标。因此,先运行安装再部署将运行两次,然后安装一次。

关于maven-2 - Maven安装和部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3405685/

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