我的包装结构如下:
src/main/java/com.mypackage/MyClass.java
src/test/java/com.mypackage/MyClassTest.java
在Test类中,我添加了一个错误的测试用例,但是当我使用mvn clean install
构建模块时,该测试未运行。但是,当我使用intellij的测试执行来运行Test类时,它会按预期运行并失败。
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.mypackage/MyClassTest
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@3d8c7aca
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.449 sec
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
Pom文件:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>artifacts</artifactId>
<groupId>com.fff.finance</groupId>
<version>1.3.0-M2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>com.fff.finance.response.type.handlers</artifactId>
<name>fff - Response Type Handlers</name>
<description>fff - Extended f Response Type Handlers</description>
<dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
</dependency>
</dependencies>
</project>
更新:
尴尬的情况是测试实际上是在某些团队成员的构建过程中执行的。它与Maven版本有关吗?