Issue
So recently, I migrated from java 11 to 17 my project and suddenly some of my tests started to fail after executing mvn clean install
command with a 500 internal error
. I wanted to debug one of the individual tests that fails to detect the problem and for my surprise when I run the command mvn -Dtest=TestClass#whenXthenY test
the test passes.
When I run mvn clean install
from the IDE it works as well.
I have no clue what could be happening here. The project is a Spring Boot project. Any idea what could be the reason of this behaviour?
Solution
The error was that I had two dependencies for the same thing (overlapping) and when I upgraded to Java 17 one of them wasn't working.
Then depending where I was running the tests from, It was taking one dependency or the other.
I removed the redundant dependency that was not working and that fixed everything.
Answered By - Paplusc
Answer Checked By - Terry (JavaFixing Volunteer)