如何从eclipse或命令行使用maven build运行集成测试
我创建了一个集成测试类“sampleIT.java”,为了测试这个类,我在eclipse中的vm参数下添加了junit的运行配置,如 -Dspring.profiles.active=it dev -Dspring.config.name=it客户端 测试正在成功运行 我试图运行maven build,它还应该包括(运行)集成测试类。我为maven build添加了运行配置,并将目标添加为 clean verify-Dspring.profiles.active=it dev-Dspring.config.name=it客户端 我在pom.xml中添加了这些内容如何从eclipse或命令行使用maven build运行集成测试,maven,Maven,我创建了一个集成测试类“sampleIT.java”,为了测试这个类,我在eclipse中的vm参数下添加了junit的运行配置,如 -Dspring.profiles.active=it dev -Dspring.config.name=it客户端 测试正在成功运行 我试图运行maven build,它还应该包括(运行)集成测试类。我为maven build添加了运行配置,并将目标添加为 clean verify-Dspring.profiles.active=it dev-Dspring.c
<profiles>
<profile>
<id>it</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<includes>
<include>**/*IT</include>
</includes>
<argLine>-Dspring.config.name=it-dev</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
信息技术
org.apache.maven.plugins
maven surefire插件
2.20.1
**/*它
-Dspring.config.name=it dev
我也在命令行中尝试过,但是集成测试没有运行
如何运行maven build以在eclipse中或从命令行运行所有junits和integration测试?您必须添加至少
mvn-Pit
因为您使用的是一个概要文件…此外,我建议在集成测试中定义Spring的概要文件。我尝试了mvn verify-Pit。成功了,谢谢。