Issue
I have a pom.xml
in that I have not explicitly mentioned to skip test cases.
When when I run it using mvn clean install
, tests are being skipped.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ raah-delta-committer ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ raah-delta-committer ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ raah-delta-committer ---
[INFO] Tests are skipped.
When ran with command -X
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ raah-delta-committer ---
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-resources-plugin:2.6:testResources from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-resources-plugin:2.6, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-resources-plugin:2.6:testResources' with basic configurator -->
[DEBUG] (f) buildFilters = []
[DEBUG] (s) delimiters = [@]
[DEBUG] (f) encoding = UTF-8
[DEBUG] (f) escapeWindowsPaths = true
[DEBUG] (s) includeEmptyDirs = false
[DEBUG] (s) outputDirectory = D:\projects\test\raah-cpp-integration\raah-delta-committer\target\test-classes
[DEBUG] (s) overwrite = false
[DEBUG] (f) project = MavenProject: com.tomtom.raah:raah-delta-committer:0.0.1-SNAPSHOT @ D:\projects\test\raah-cpp-integration\raah-delta-committer\pom.xml
[DEBUG] (s) resources = [Resource {targetPath: null, filtering: false, FileSet {directory: D:\projects\test\raah-cpp-integration\raah-delta-committer\src\test\resources, PatternSet [includes: {}, excludes: {}]}}]
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@69c6161d
[DEBUG] (f) skip = true
[DEBUG] (f) supportMultiLineFiltering = false
[DEBUG] (f) useBuildFilters = true
[DEBUG] (s) useDefaultDelimiters = false
[DEBUG] -- end configuration --
[INFO] Not copying test resources
My parent POM profile is
<profiles>
<profile>
<id>sonar-coverage</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.2.201409121644</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<append>true</append>
</configuration>
<executions>
<execution>
<id>agent-for-ut</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>agent-for-it</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
My parent build is
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.4</version>
<configuration>
<tag>${project.artifactId}-${project.version}</tag>
<basedir>${project.basedir}</basedir>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
My child build is
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Solution
I m pretty sure that some where in your pom.xml(configuration) you are skipping test.
Please follow the following step to identify the issue -
1 - if you are using eclipse IDE them open your effective pom.xml(resolved pom for your parent project), and search
a- maven.skip.test or
b- skip.test
I hope you could be able to find out one of this, if you find then,
2- search that in your all parent hierarchy pom.xml's.
if its not fount in parent pom.xml and then,
3- search that in maven setting.xml where some time global properties are set.
Answered By - Afgan
Answer Checked By - Clifford M. (JavaFixing Volunteer)