Maven安装和部署 [英] Maven install and deploy

查看:89
本文介绍了Maven安装和部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我们在CI服务器中的设置,我有些疑问. 用于构建应用程序的maven命令在Bamboo中配置为"mvn安装部署" .

I have some doubt regarding our setup in our ci server. The maven command used to build applications is configured in bamboo as "mvn install deploy".

据我所知,这将调用直到安装" 的所有阶段,然后再次调用直到"deploy" 的所有阶段,这意味着并且尽我所能在我们的日志中看到,应用程序被构建了两次(两次编译,两次测试)等等.这也意味着,应用程序需要花费几乎两倍的构建时间.

As of my understanding this would invoke all phases up to "install" and then invoke all phases again up to "deploy", which would mean and as I can see in our logs, that the applications are build twice (twice compile, twice test) etc.. Which also means that the applications takes almost twice as long to build as needed.

只需"mvn部署" 即可正确构建应用程序.

All that's needed is "mvn deploy" to correctly build the applications.

我的理解/观察正确吗?

Is my understanding/observation correct?

推荐答案

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

Yes all you have to do is look at the execution life cycle.

  • 验证-验证项目是否正确以及所有必要信息 可用
  • compile-编译项目的源代码
  • test-使用适当的单元测试来测试已编译的源代码 框架.这些测试不应该 要求将代码打包或 部署
  • 程序包-提取已编译的代码并将其打包为可分发的代码 格式,例如JAR.
  • 集成测试-如有必要,将程序包处理并部署到 集成测试的环境 可以运行
  • 验证-运行任何检查以验证包装是否有效并符合质量 条件
  • install-将软件包安装到本地存储库中,以用作 依赖其他本地项目
  • 部署-在集成或发布环境中完成,复制最终版本 打包到远程存储库 与其他开发者共享 项目.
  • 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将运行所有其他阶段,然后说出目标.因此,先运行安装再部署将运行两次,然后安装一次.

Here you can see that install happens right before deploy. What is important to know that when you run deploy, maven will run all other phases and then said goal. So running install then deploy will run up to install twice then a single deploy.

这篇关于Maven安装和部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆