Questions tagged [maven-failsafe-plugin]

The Maven Failsafe Plugin is used to run integration tests with Maven build tools.

The Maven Failsafe Plugin is designed to run integration tests while the Surefire Plugin is designed to run unit tests. The name (failsafe) was chosen both because it is a synonym of surefire and because it implies that when it fails, it does so in a safe way.

This plugin is strictly linked to the following Maven phases: integration-test, verify. However, during its usage, the pre-integration-test and post-integration-test phases are also often used (i.e. set-up and tear-down of an embedded web server).

Check the official usage page for a first look at this plugin.

375 questions
16
votes
3 answers

Maven Failsafe fails with java.lang.NoClassDefFoundError

I've started a new project: PostfixSQLConfig. It's a simple Spring Boot application that is essentialy supposed to provide CRUD access for 4 simple databse tables. I wrote the the repository for the first table and some basic integration tests for…
Konrad Botor
  • 4,765
  • 1
  • 16
  • 26
16
votes
2 answers

Configuring maven-failsafe-plugin to find integration tests not in src/test/java

My directory structure is like so: src/integrationTest/java src/test/java src/main/java I am trying to get failsafe to pick-up the integration tests, but failing to do so in the way I would like. I have tried this:
neuronotic
  • 487
  • 7
  • 18
16
votes
1 answer

Maven Failsafe Plugin: how to use the pre- and post-integration-test phases

It is not completely clear to me how to best use the Maven Failsafe plugin for integration tests. My use case would be to test SQL queries against a local MySQL database. I understand that the database should be started during the…
FBB
  • 1,414
  • 2
  • 17
  • 29
14
votes
2 answers

How to run integration test of a spring-boot based application through maven-failsafe-plugin?

I have a spring-boot based application, and the pom.xml file is configured as below.
13
votes
2 answers

Why doesn't "mvn verify" run my integration tests?

I have a multi-module project and I have failsafe defined in the root pom like this: org.apache.maven.plugins maven-failsafe-plugin 2.19
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
13
votes
3 answers

Maven does not run integration tests using failsafe-plugin

I know this question is asked more than once. But I cannot make maven run my integration tests using failsafe-plugin. When I execute mvn failsafe:integration-test failsafe:verify it runs my integration tests. But when I execute mvn verify my…
bhdrkn
  • 6,244
  • 5
  • 35
  • 42
12
votes
2 answers

Where should the integration tests be stored when using the maven-failsafe-plugin?

Do I have to place my integration tests under src/test with the rest of my unit tests and just distinguish them by a pattern such as *Integr*Test, *ITTest, or can they be in src/it (as is the case when developing Maven plugins and using the…
carlspring
  • 31,231
  • 29
  • 115
  • 197
11
votes
1 answer

How to get the full stacktrace of failed tests in failsafe?

I have a JUnit integration test that fails throwing an exception when executed by the Maven Failsafe plugin. I configured failsafe to write system out to a test-specific file (redirectTestOutputToFile=true). But neither that file nor the XML test…
Gustave
  • 3,359
  • 4
  • 31
  • 64
11
votes
2 answers

Using JUnit Categories with Maven Failsafe plugin

I'm using JUnit Categories to separate integration tests from unit tests. The Surefire plugin configuration works - it skips the tests annotated with my marker interface IntegrationTest. However, the Failsafe plugin doesn't pick the integration…
brabec
  • 4,632
  • 8
  • 37
  • 63
10
votes
2 answers

TypeNotPresentExceptionProxy error at integration-test with maven-failsafe-plugin spring-boot 1.4

I'm getting ArrayStoreException: TypeNotPresentExceptionProxy when running integration-test with maven-failsafe-plugin and spring-boot 1.4. You can see this error if you run joinfaces-example with mvn -Pattach-integration-test clean install I…
10
votes
2 answers

Why failsafe plugin requires both integration-test and verify goals?

I have the next pom.xml ... maven-failsafe-plugin 2.6 integration-test
gokareless
  • 1,165
  • 1
  • 10
  • 26
10
votes
2 answers

Maven deploy multiple wars to embedded server for integration tests

I have had no issue running a maven war project on an embedded server for its own integration tests, but now I need to run multiple wars and test from a different project. I would like to setup the following scenario... I have two Maven war projects…
smp7d
  • 4,947
  • 2
  • 26
  • 48
9
votes
1 answer

How to skip surefire tests but run failsafe tests?

In my project I have surefire as well as failsafe tests. If I run with mvn clean install -DskipTests then both kinds of tests are skipped. If I try to run a single failsafe test using -Dit.test=TestName then first all surefire tests run and then my…
8
votes
2 answers

IT are no longer executed with failsafe plugin after migrating to Spring Boot 2.4.0

I have some integration tests that are run with the failsafe plugin. This works until Spring Boot 2.3.5.RELEASE, but after migrating to 2.4.0 the ITs are no longer executed. Does anybody have the same problem? How can I debug failsafe to find out…
Simon Martinelli
  • 34,053
  • 5
  • 48
  • 82
8
votes
2 answers

Getting "Expecting a stackmap frame at branch target" when running Maven integration testing

I’m using Maven 3.2.3 with this version of Java davea$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home When I run mvn clean install I get errors like the below in my integration tests…
Dave
  • 15,639
  • 133
  • 442
  • 830
1
2
3
24 25