I have migrate my Spring-Boot App to java 17.0.9 from java 8. I have been observer my Integration test case failing at compile time when build using mvn package -p. But its Running properly if i run as junit test cases. I was getting below error after run build using mvn package command Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.8:test (default-test) on project sxi-automated-testing: Execution default-test of g oal org.apache.maven.plugins:maven-surefire-plugin:2.8:test failed.: UndeclaredThrowableException: InvocationTargetException: javax/sql/DataSource: javax.sql.DataS ource
I want to compile and run successfully my test using mvn package command. I tried with same but its failing on my local mahine