我有一个包含两个WAR的多模块Maven 2 POM,如何配置它以在运行测试之前部署两次战争? [英] I have a multi-module Maven 2 POM that has two WARs, how can I configure it to deploy both wars prior to running tests?

查看:210
本文介绍了我有一个包含两个WAR的多模块Maven 2 POM,如何配置它以在运行测试之前部署两次战争?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大致来说,我有一个项目pom打包(例如),它有两个模块M1和M2(比如说),每个模块都有战争包装. M2进行了集成测试,但是M2战争向M1战争发出了服务电话.这应该确实是:

Roughly, I have (say) project A, pom packaging, that have two module M1 and M2 (say) each of which have war packaging. M2 has integration tests, but the M2 war makes service calls to the war of M1. This should really:

  1. 将相同的数据加载到数据库中.
  2. 部署M1的WAR.
  3. 部署M2的WAR.
  4. 运行M2的IT测试.
  5. 取消部署M1和M2.

推荐答案

我将使用db maintenance maven插件进行数据库部署,并使用maven wagon插件将war文件部署到容器中.您将不得不将wagon配置添加到m1 + m2两个模块中,但是……第二次更容易了:)

I would use something like the db maintain maven plugin for the database deployment and the maven wagon plugin to deploy the war files into the container. You will have to add the wagon config into both m1+m2 modules but well... the second time is easier :)

这篇关于我有一个包含两个WAR的多模块Maven 2 POM,如何配置它以在运行测试之前部署两次战争?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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