简体   繁体   English

我有一个包含两个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?

Roughly, I have (say) project A, pom packaging, that have two module M1 and M2 (say) each of which have war packaging. 大致来说,我有一个项目A,即pom包装,它有两个模块M1和M2(例如),每个模块都有战争包装。 M2 has integration tests, but the M2 war makes service calls to the war of M1. M2进行了集成测试,但是M2战争向M1战争发出了服务电话。 This should really: 这应该确实是:

  1. Load same data into the DB. 将相同的数据加载到数据库中。
  2. Deploy M1's WAR. 部署M1的WAR。
  3. Deploy M2's WAR. 部署M2的WAR。
  4. Run M2's IT tests. 运行M2的IT测试。
  5. Undeploy M1 and M2. 取消部署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. 我将使用诸如db maintenance maven插件之类的东西来进行数据库部署,并使用maven wagon插件来将war文件部署到容器中。 You will have to add the wagon config into both m1+m2 modules but well... the second time is easier :) 您将不得不将wagon配置添加到两个m1 + m2模块中,但是……第二次变得更容易了:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何编译一个多模块Maven项目,其中一个模块同时具有clojure和Java代码 - How can I compile a multi-module maven project, where a module have both clojure and java code 在多模块Maven项目中构建所有模块后,如何运行集成测试? - How can I run integration tests after building all modules in a multi-module Maven project? 如何引用多模块Maven项目? - How can I reference a multi-module maven project? 如果我将测试放在单独的模块中,如何在多模块 maven 设置中运行单元测试? - How to run unit tests in multi-module maven setup if i put the tests in a separate module? 如何在没有指定版本的情况下拥有多模块Maven项目? - How can I have a multi-module Maven project without specifying the version all over the place? 多模块项目交付两场不同的战争 - Multi module project to deliver two different wars 多模块Maven POM - Multi-module Maven POM 我可以在多模块项目的基础pom中打仗吗? - Can I build a war in the base pom of a multi-module project? Maven将多次战争部署到嵌入式服务器以进行集成测试 - Maven deploy multiple wars to embedded server for integration tests 如何配置SonarQube以显示多模块Maven项目的所有模块? - How do I configure SonarQube to display all modules of a multi-module maven project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM