0

我有多模块项目。它构建到 EAR。我添加了 arquillian 库。每个子模块都有自己的测试,但要工作,它必须编译其他模块。我想在耳朵构建后运行所有测试,然后使用这个耳朵进行部署和测试。是否有可能在单个 Maven 构建生命周期中执行此操作?

4

2 回答 2

1

构建 ear 后要运行的测试应该在构建ear.

将 ear 部署到容器中时执行的测试称为“集成测试”,并在阶段执行integration-test。您可以使用特殊模式(例如 )调用此类测试用例BlaBlaIntegrationTest并执行适当的配置pom.xml以仅在“集成测试”阶段运行这些测试,并在运行常规单元测试时忽略它们。

于 2013-06-06T07:34:08.250 回答
0

标准的生命周期阶段是:

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.

我建议你在集成测试阶段打包你的 arquillian 测试。如果配置正确,Arquillian 应该在测试机器上自行部署微部署。

于 2013-06-06T07:33:49.080 回答