Skip to content
Advertisement

Integration test fails when upgrading failsafe but passes within intellij

I have a multi maven module project. The project runs fine and everything passes, but if I upgrade failsafe plugin from 2.22.2 to the latest version 3.0.0-M5 the integration test within two of the maven modules(client and server-with-jersey) fails. I have tried different configuration, but I am not quite sure what to do anymore… So I am hoping that the someone can explain me what I am maybe doing wrong…

The project can be found here: https://github.com/Hakky54/mutual-tls-ssl

It is just a tutorial of setting up ssl/tls for different clients and servers, so I need to warn you if you run it locally it will pull a-lot dependencies…

The plugin configuration is:

JavaScript

The pom of the failing module is:

JavaScript

And the following integration test is failing: AppIT. But if I run this within intellij idea it passes, but with mvn clean install it gives me the following exception:

JavaScript

Advertisement

Answer

Maybe you should give it a try with a temporal workaround.

Let’s start with investigating the problem. Enable the debug log and run the tests

JavaScript

and investigate the classpath printed on the console.

I have noticed that you are using the maven-shade-plugin which modifies the content of JAR file. I think the problem might be with classpath. We changed the maven-failsafe-plugin so that the classpath contains the path pointing to the attached main JAR. On the opposite site the maven-surefire-plugin uses target/classes instead. The Failsafe plugin is used for the integration tests and uses the JAR file which is more realistic approach of testing the application.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement