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
4
votes
2 answers

How to run maven failsafe without compiling first

I have a multi-module project with unit tests and integration tests. We're using Jenkins for our pipeline: build + unit tests deploy to staging integration tests against staging. What I want to achieve is: Step one - build + unit test + package +…
Issahar Weiss
  • 203
  • 1
  • 10
4
votes
0 answers

Maven Failsafe Plugin not adding target/classes to classpath

I have the following default configuration for the Maven Failsafe Plugin: maven-failsafe-plugin 2.20 default-integration-test
Charles
  • 4,372
  • 9
  • 41
  • 80
4
votes
3 answers

How to skip integration tests by default but still run them on-demand in multi-module maven project?

I have a multi module project having the following structure: Project: - module1 - module2 - integration-test - parent pom What is the correct way of achieving the following: run unit tests from all modules(except integration-test)…
vikesh pandey
  • 210
  • 2
  • 8
4
votes
0 answers

Is it possible to pass null property's value in pom.xml?

I have a property which is designed like -dVerbose in mvn dependency:tree plugin. It does not require any value. If it is specified then some additional work is done in my application's tests. So in Maven failsafe plugin i would like to either set…
Kirill
  • 6,762
  • 4
  • 51
  • 81
4
votes
0 answers

Maven failsafe plugin integration-test passes but verify fails with error

I have a project with a Maven continuous build in Jenkins. When the maven-failsafe-plugin:integration-test phase runs, it says there are 0 failures and 0 errors. However, when the maven-failsafe-plugin:verify runs, it says "[ERROR] There are test…
ocarlsen
  • 1,312
  • 2
  • 16
  • 20
4
votes
1 answer

Running maven multi-module failsafe tasks independently from mvn clean package

I have a multi-module project a. Sub-module x includes an a simple integration test which requires also a dependency on sub-module y. I would like to be able to separate the compilation and package phase from running the tests. When I run the…
itaifrenkel
  • 1,578
  • 1
  • 12
  • 26
4
votes
2 answers

Maven failsafe plugin will not run test classes annotated with JUnit Category

I have an interface like this: public interface IntegrationTest { } I configure the failsafe plugin like this: org.apache.maven.plugins maven-failsafe-plugin 2.14
Jörgen Lundberg
  • 1,799
  • 3
  • 22
  • 31
3
votes
2 answers

Maven surefire/failsafe TestNG 7.4.0 parallel Error 'void org.testng.xml.XmlSuite.setParallel(java.lang.String)'

When upgrading from TestNG 4.6.0 to 4.7.0 I get the following error when trying to run the FailSafe goal. mvn verify ... [INFO] --- maven-failsafe-plugin:3.0.0-M5:integration-test (default) @ project --- [INFO] [INFO]…
Graham Russell
  • 997
  • 13
  • 24
3
votes
1 answer

Maven Exec Plugin is Blocked and HTTP Server starts after Integration Tests are executed

I have been trying to convert our Integration tests to use the Maven Exec Plugin to start a server but it will only start the HTTP Server after the Integration tests have been executed, even though I have pre-integration-test…
M_K
  • 3,247
  • 6
  • 30
  • 47
3
votes
2 answers

Quarkus native image build fails with unknown arguments

I am building a quarkus native executable image but it is failing because of unknown argument . I have used quarkus.native.additional-build-args variable in property file but it is not working. I am using java 11. Can SLF4J: Found binding in…
Coder
  • 31
  • 5
3
votes
0 answers

Cucumber and SpringBootTest via Failsafe plugin

I'm having issues getting my cucumber tests to be invoked. I'm using SpringBootTest for these and invoking them via the maven failsafe plugin. I know for a fact that the features path is correct because 1. If I run the tests directly using…
xandermonkey
  • 4,054
  • 2
  • 31
  • 53
3
votes
1 answer

How to run Maven Failsafe integration tests from a jar file?

I have a Spring Boot multi module Maven project, I can run integration tests with: mvn clean verify and it works well. I now want to run the same integration tests from a container and I don't want to embed all the source code in the container. My…
Ortomala Lokni
  • 56,620
  • 24
  • 188
  • 240
3
votes
3 answers

SpringBoot without parent pom failsafe integration tests are failing

I need to inherit from my organization's parent pom so I have following setup.
K. Siva Prasad Reddy
  • 11,786
  • 12
  • 68
  • 95
3
votes
2 answers

mvn spring boot plugin breaks integration testing

My integration testing with maven-failsafe-plugin and JUnit5 was difficult to set up initially, but it now works: plugins: - artifactId: maven-failsafe-plugin groupId: org.apache.maven.plugins version: 2.19.1 dependencies: -…
Adam
  • 5,215
  • 5
  • 51
  • 90
3
votes
2 answers

Maven - Add Integration Tests

trying to split my tests in a Maven build into Unit & Integration tests. I am using the failsafe plugin to run the Integration Tests and attempting to use the build-helper-maven-plugin to add the Integration Tests from the src/it/java directory. I…