Open
Description
Jakub Bochenski opened MDEP-977 and commented
PostgreSQLContainer extends GenericContainer which is a FailureDetectingExernalResource which then implements org.junit.rules.TestRule.
I think the case when you use Testcontainers in your main sources, while also have JUnit tests in your test sources is not handled correctly:
If you declare in pom.xml
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
</dependency>
then the analyze will fail with:
[INFO] --- dependency:3.8.1:analyze-only (analyze-only) @ persistence-test ---
[ERROR] Non-test scoped test only dependencies found:
[ERROR] junit:junit:jar:4.13.2:compile
This is wrong - Junit needs to be in compile scope because of the Testcontainers classes extending it.
Affects: 3.8.1