When use this configuration I receive the initializationError of the JUnit Vintage:
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
But with this configuration @RunWith annotation isn't resolved:
testImplementation (group: 'org.springframework.boot', name: 'spring-boot-starter-test') {
exclude group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.7.0-M1'
}
How can I correctly exclude the JUnit Vintage module?
You just need to remove the version number from the exclude specification (as that would exclude a particular version that is not used anyway):