我正在使用Apache Maven 3.5.2;我在pom.xml中定义了两个插件:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.20.1</version> <configuration> <excludes> <exclude>TestApplicationProperties</exclude> <exclude>IT*</exclude> </excludes> <include>*UnitTest*</include> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.20.1</version> <configuration> <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory> <argLine>${jacoco.agent.argLine}</argLine> </configuration> </plugin>
我想要做的是运行带有mvn test
目标的单元测试用例和带有mvn verify
目标的积分测试。
当我运行$ mvn verify
时,它会运行surefire:test目标,然后运行failsafe:verify目标。为什么它会运行万无一失:首先测试目标?