I am using IntelliJ to build a spring boot project in Java 9.
But I'm getting
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
whenever i use @SpringBootTest
or @DataJpaTest
.
Following this post I added --add-modules=java.xml.bind
in the Run Configuration - VM options which fixed the problem but only for that Run Configuration on which I added it.
Now i have multiple Test Classes that make use of @SpringBootTest
or @DataJpaTest
and if I manually go and add the --add-modules=java.xml.bind
to each Run Configuration, each on works individually but when i try to for example
src/test/java -> right click and Run Tests
(on the whole test suite)
- it doesn't consider those individual Run Configuration and hence fails for those tests,
Is there any option to add the VM options - so that they are considered during integration test runs.