I have the following package structure:
src/main/java/com.mypackage/MyClass.java
src/test/java/com.mypackage/MyClassTest.java
And in the Test class, I had added a faulty test case, but when I build the module using mvn clean install
, the test is not run. However, when I run the Test class using intellij's test execution, it is run and fails as expected.
-------------------------------------------------------
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 file:
<?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>
Update:
The awkward scenario is that the tests are actually executed during build for certain team members. Does it have something to do with the maven version?