jhipster-lite
jhipster-lite copied to clipboard
testcontainers: exclude junit
When there is testcontainers
dependency, there are 2 junit dependencies. The results in IDE are:
To avoid this, we should exclude junit:
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>${testcontainers.version}</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
I stumbled upon this issue a few days ago, but it's not as simple as excluding the dependency. See https://github.com/testcontainers/testcontainers-java/issues/970 There's still a runtime dependency required by testcontainers. A workaround is to recreate fake junit4 rules: https://github.com/spring-projects-experimental/spring-boot-migrator/pull/777/files#diff-f3362ff9066efd77e7727c970892542c62437c2340439773fde412786623bbd4
Oh nice catch @murdos In my project, I don't use GenericContainer so that's why I'm fine, and for existing modules, there is no use of it
Let's close this, as it's not so important to fix it, and it will be fixed automatically one day, I think :)