Questions tagged [surefire]

The Surefire Maven Plugin is used during the test phase of the build lifecycle to execute the unit tests of an application. It is commonly used in continuous integration.

The Surefire Plugin is used during the test phase of the build lifecycle to execute the unit tests of an application. It generates reports in two different file formats:

Plain text files (.txt)
XML files (
.xml)

By default, these files are generated at ${basedir}/target/surefire-reports.

The Surefire Plugin has only one goal:

surefire:test

runs the unit tests of an application.

Related tags :

278 questions
11
votes
3 answers

maven surefire reporting plugin configuration

I have a multi-module maven project. The parent pom.xml is simply a way to reference common information for the 4 subprojects. I have quite a few JUnit tests that run and I also have the Parent Project set up for Project WebSite using the…
Peter Delaney
  • 5,278
  • 9
  • 33
  • 40
10
votes
2 answers

Changing order of locations on classpath to be loaded up by surefire-plugin

Does anybody know how to change it ? I mean from target/test-classes ... target/classes .... maven dependencies to target/test-classes ... maven dependencies .... target/classes It relates to this surefire-plugin feature request It's because…
lisak
  • 21,611
  • 40
  • 152
  • 243
10
votes
3 answers

TestNG surefire, run suite with maven command line

Is it possible to run a predefined xml suite from the command line through maven? I am able to run a class or a particular test. But I am unable to run a suite. Here is what I am running from the command line: --> mvn -Dtest=TestCircle#mytest…
fohtoh
  • 343
  • 1
  • 3
  • 13
9
votes
4 answers

Surefire rerun failing tests not working

I want to rerun a test that I know will fail cause I am trying to test the Surefire parameter for re-running the failing tests. I tried running Maven with these two commands neither of them works as expected -Dsurefire.rerunFailingTestsCount=2…
hocikto
  • 871
  • 1
  • 14
  • 29
9
votes
1 answer

How do I make the manifest available during a Maven/Surefire unittest run "mvn test"?

How do I make the manifest available during a Maven/Surefire unittest run "mvn test" ? I have an open-source project that I am converting from Ant to Maven, including its unit tests. Here's the project source repository with the Maven…
Ernst de Haan
  • 467
  • 6
  • 12
8
votes
8 answers

Maven Surefire: Unable to fork parallel test execution

using Maven surefire, I'm unable to fork parallel test execution. That is, each of my test cases hs to run in a serapate JVM, hence the forking. In addition, I want my test cases to run in parallel. the first part is working without problem: I'm…
Gregoire
  • 91
  • 1
  • 3
8
votes
1 answer

Error creating code coverage report with JaCoCo

I'm trying to add report generation for code coverage using JaCoCo. The project is using Maven, so i have jacoco maven plugin configured like this: org.jacoco
dty
  • 466
  • 2
  • 6
  • 17
8
votes
1 answer

Maven surefire test results for a project with various modules

I've a parent pom project with various submodules. I want to get a report of the unit tests results but using surfire plugin, I get an independent result for each module. I mean, if I execute: mvn surefire-report:report from the parent directory…
drublik
  • 456
  • 2
  • 5
  • 19
7
votes
1 answer

How to output failed test's strack traces to the console

I'm running a single test from Maven: mvn test -Dtest=TestCircle If the test fails, Maven outputs the exceptions in /target/... folder. Is there a way to tell Maven that this exception should be printed directly on the console, so I don't have to…
Igor Mukhin
  • 15,014
  • 18
  • 52
  • 61
7
votes
2 answers

Maven surefire forkMode pertest deprecated. What is the new settings?

As of Surefire 2.14 the forkMode configuration setting has been deprecated. They even helpfully provide a mapping from some of the old settings to new settings here…
7
votes
1 answer

Intellij not picking up maven surefire configuration

In my surefire configuration I have a classpathDependencyExcludes entry. For some reason Intellij does not seem to pick up this configuration (mvn test, does). Is there any way to have Intellij notice my surfire configuration? Ps. It seems like…
dstibbe
  • 1,589
  • 18
  • 33
7
votes
0 answers

Passing a custom java security policy file to surefire maven test fails, results in access control error for everything

I'm trying to pass a custom security policy file to surefire to run some tests. (Specifically, I'm adding classes in java.lang to test a profiler and I want permission to define classes in there.) I'm not sure if my problem is with the security…
adapt-dev
  • 1,608
  • 1
  • 19
  • 30
7
votes
1 answer

Maven Surefire plugin "error in starting fork" while building project with Intellij IDEA

I was trying building a Java plugin with Maven using Intellij IDEA until I came across an error: [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]…
octopod
  • 824
  • 2
  • 10
  • 23
7
votes
2 answers

Junit run not picking file src/test/resources. For file required by some dependency jar

I m facing a issue where test/resource is not picked,but instead jar's main/resource is picked Scenario is like : Myproject src/test/resources--- have config.xml w which should be needed by abc.jar which is a dependecy in Myproject. When running…
saddy dj
  • 147
  • 1
  • 3
  • 13
7
votes
3 answers

mvn test fails because of Surefire JDK version?

I am trying to run mvn test on my project. The project itself compiles and installs but man test fails with the following output: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18:test (default-test) on project…
Ree
  • 863
  • 2
  • 18
  • 38
1 2
3
18 19