Add testcontainers2 module: Testcontainers 2.0 artifact renames, JUnit 4 removal, and the Docker API version bump

Verifies five claims against primary sources rather than release-note prose: the
org.testcontainers:junit-jupiter -> testcontainers-junit-jupiter rename (and the other 60 like
it, per OpenRewrite's own Testcontainers2Migration recipe), that GenericContainer no longer
implements org.junit.rules.TestRule anywhere in the 2.0.5 jar (confirmed exhaustively, not just
for this one class), the real compiler/dependency-resolution breaks from bumping only a version
number on existing JUnit 4 @ClassRule code, the literal 1.32 -> 1.44 default Docker API version
bump in DockerClientProviderStrategy's bytecode (tied to the real Docker Engine 29 compatibility
issue), and Spring Boot 4.1.1's BOM pinning 2.0.5. Built and tested with no Docker daemon
available; one test class demonstrates a clean @EnabledIfDockerAvailable skip, guarded at the
class level after the method-level guard was caught failing first.
This commit is contained in:
2026-10-08 13:19:23 +00:00
parent 2b2fbe54a2
commit fd3434c42d
11 changed files with 597 additions and 0 deletions
@@ -0,0 +1,48 @@
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.ankurm:testcontainers2 >---------------------
[INFO] Building testcontainers2 1.0.0
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ testcontainers2 ---
[INFO] Deleting /home/claude/JUnit_Tutorials/testcontainers2/target
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ testcontainers2 ---
[INFO] skip non existing resourceDirectory /home/claude/JUnit_Tutorials/testcontainers2/src/main/resources
[INFO]
[INFO] --- compiler:3.13.0:compile (default-compile) @ testcontainers2 ---
[INFO] No sources to compile
[INFO]
[INFO] --- resources:3.3.1:testResources (default-testResources) @ testcontainers2 ---
[INFO] skip non existing resourceDirectory /home/claude/JUnit_Tutorials/testcontainers2/src/test/resources
[INFO]
[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ testcontainers2 ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 2 source files with javac [debug release 25] to target/test-classes
[INFO]
[INFO] --- surefire:3.6.0:test (default-test) @ testcontainers2 ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Running com.ankurm.tutorials.junit.testcontainers2.NewPostgresContainerSkipsCleanlyTest
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.037 s -- in com.ankurm.tutorials.junit.testcontainers2.NewPostgresContainerSkipsCleanlyTest
[INFO] Running com.ankurm.tutorials.junit.testcontainers2.GenericContainerNoLongerImplementsTestRuleTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.166 s -- in com.ankurm.tutorials.junit.testcontainers2.GenericContainerNoLongerImplementsTestRuleTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.007 s
[INFO] Finished at: 2026-10-08T18:47:18+05:30
[INFO] ------------------------------------------------------------------------
@@ -0,0 +1,107 @@
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.ankurm:testcontainers2 >---------------------
[INFO] Building testcontainers2 1.0.0
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ testcontainers2 ---
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ testcontainers2 ---
[INFO] skip non existing resourceDirectory /home/claude/JUnit_Tutorials/testcontainers2/src/main/resources
[INFO]
[INFO] --- compiler:3.13.0:compile (default-compile) @ testcontainers2 ---
[INFO] No sources to compile
[INFO]
[INFO] --- resources:3.3.1:testResources (default-testResources) @ testcontainers2 ---
[INFO] skip non existing resourceDirectory /home/claude/JUnit_Tutorials/testcontainers2/src/test/resources
[INFO]
[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ testcontainers2 ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 2 source files with javac [debug release 25] to target/test-classes
[INFO]
[INFO] --- surefire:3.6.0:test (default-test) @ testcontainers2 ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit-platform/3.6.0/surefire-junit-platform-3.6.0.pom
Progress (1): 833 B␍Progress (1): 3.9 kB␍Progress (1): 4.6 kB␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit-platform/3.6.0/surefire-junit-platform-3.6.0.pom (4.6 kB at 9.3 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/3.6.0/surefire-providers-3.6.0.pom
Progress (1): 872 B␍Progress (1): 1.8 kB␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/3.6.0/surefire-providers-3.6.0.pom (1.8 kB at 26 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/3.6.0/common-java5-3.6.0.pom
Progress (1): 844 B␍Progress (1): 2.4 kB␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/3.6.0/common-java5-3.6.0.pom (2.4 kB at 49 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-engine/1.14.4/junit-platform-engine-1.14.4.pom
Progress (1): 953 B␍Progress (1): 3.2 kB␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-engine/1.14.4/junit-platform-engine-1.14.4.pom (3.2 kB at 37 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-commons/1.14.4/junit-platform-commons-1.14.4.pom
Progress (1): 967 B␍Progress (1): 2.9 kB␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-commons/1.14.4/junit-platform-commons-1.14.4.pom (2.9 kB at 63 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-launcher/1.14.4/junit-platform-launcher-1.14.4.pom
Progress (1): 968 B␍Progress (1): 3.0 kB␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-launcher/1.14.4/junit-platform-launcher-1.14.4.pom (3.0 kB at 73 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit-platform/3.6.0/surefire-junit-platform-3.6.0.jar
Progress (1): 7.7/57 kB␍Progress (1): 16/57 kB ␍Progress (1): 32/57 kB␍Progress (1): 33/57 kB␍Progress (1): 49/57 kB␍Progress (1): 57 kB ␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit-platform/3.6.0/surefire-junit-platform-3.6.0.jar (57 kB at 1.1 MB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/3.6.0/common-java5-3.6.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-engine/1.14.4/junit-platform-engine-1.14.4.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-commons/1.14.4/junit-platform-commons-1.14.4.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-launcher/1.14.4/junit-platform-launcher-1.14.4.jar
Progress (1): 7.7/272 kB␍Progress (1): 8.2/272 kB␍Progress (1): 25/272 kB ␍Progress (1): 36/272 kB␍Progress (1): 52/272 kB␍Progress (1): 69/272 kB␍Progress (1): 85/272 kB␍Progress (1): 101/272 kB␍Progress (1): 118/272 kB␍Progress (1): 134/272 kB␍Progress (1): 151/272 kB␍Progress (1): 159/272 kB␍Progress (1): 175/272 kB␍Progress (1): 192/272 kB␍Progress (1): 200/272 kB␍Progress (1): 216/272 kB␍Progress (1): 233/272 kB␍Progress (1): 249/272 kB␍Progress (1): 265/272 kB␍Progress (1): 272 kB ␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-engine/1.14.4/junit-platform-engine-1.14.4.jar (272 kB at 2.6 MB/s)
Progress (1): 7.7/16 kB␍Progress (1): 11/16 kB ␍Progress (1): 16 kB ␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/3.6.0/common-java5-3.6.0.jar (16 kB at 102 kB/s)
Progress (1): 7.7/164 kB␍Progress (1): 16/164 kB ␍Progress (2): 16/164 kB | 7.7/223 kB␍Progress (2): 16/164 kB | 16/223 kB ␍Progress (2): 16/164 kB | 16/223 kB␍Progress (2): 16/164 kB | 25/223 kB␍Progress (2): 16/164 kB | 33/223 kB␍Progress (2): 16/164 kB | 41/223 kB␍Progress (2): 32/164 kB | 41/223 kB␍Progress (2): 49/164 kB | 41/223 kB␍Progress (2): 57/164 kB | 41/223 kB␍Progress (2): 65/164 kB | 41/223 kB␍Progress (2): 73/164 kB | 41/223 kB␍Progress (2): 73/164 kB | 49/223 kB␍Progress (2): 73/164 kB | 57/223 kB␍Progress (2): 73/164 kB | 66/223 kB␍Progress (2): 73/164 kB | 74/223 kB␍Progress (2): 81/164 kB | 74/223 kB␍Progress (2): 98/164 kB | 74/223 kB␍Progress (2): 98/164 kB | 90/223 kB␍Progress (2): 114/164 kB | 90/223 kB␍Progress (2): 114/164 kB | 98/223 kB␍Progress (2): 114/164 kB | 106/223 kB␍Progress (2): 131/164 kB | 106/223 kB␍Progress (2): 147/164 kB | 106/223 kB␍Progress (2): 163/164 kB | 106/223 kB␍Progress (2): 164 kB | 106/223 kB ␍Progress (2): 164 kB | 115/223 kB␍Progress (2): 164 kB | 131/223 kB␍Progress (2): 164 kB | 147/223 kB␍Progress (2): 164 kB | 163/223 kB␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-commons/1.14.4/junit-platform-commons-1.14.4.jar (164 kB at 918 kB/s)
Progress (1): 171/223 kB␍Progress (1): 180/223 kB␍Progress (1): 196/223 kB␍Progress (1): 212/223 kB␍Progress (1): 223 kB ␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-launcher/1.14.4/junit-platform-launcher-1.14.4.jar (223 kB at 1.2 MB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/junit/vintage/junit-vintage-engine/6.1.3/junit-vintage-engine-6.1.3.pom
Progress (1): 956 B␍Progress (1): 3.3 kB␍Progress (1): 3.5 kB␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/junit/vintage/junit-vintage-engine/6.1.3/junit-vintage-engine-6.1.3.pom (3.5 kB at 90 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/junit/vintage/junit-vintage-engine/6.1.3/junit-vintage-engine-6.1.3.jar
Progress (1): 7.7/81 kB␍Progress (1): 16/81 kB ␍Progress (1): 24/81 kB␍Progress (1): 32/81 kB␍Progress (1): 49/81 kB␍Progress (1): 65/81 kB␍Progress (1): 81/81 kB␍Progress (1): 81 kB ␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/org/junit/vintage/junit-vintage-engine/6.1.3/junit-vintage-engine-6.1.3.jar (81 kB at 1.6 MB/s)
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.ankurm.tutorials.junit.testcontainers2.NewPostgresContainerSkipsCleanlyTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.676 s <<< FAILURE! -- in com.ankurm.tutorials.junit.testcontainers2.NewPostgresContainerSkipsCleanlyTest
[ERROR] com.ankurm.tutorials.junit.testcontainers2.NewPostgresContainerSkipsCleanlyTest.initializationError -- Time elapsed: 1.676 s <<< ERROR!
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$7(DockerClientProviderStrategy.java:274)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:265)
at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:154)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:196)
at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:108)
at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:111)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:316)
at org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.start(TestcontainersExtension.java:276)
at org.testcontainers.junit.jupiter.TestcontainersExtension$StoreAdapter.access$200(TestcontainersExtension.java:263)
at org.testcontainers.junit.jupiter.TestcontainersExtension.lambda$startContainers$4(TestcontainersExtension.java:83)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
at org.testcontainers.junit.jupiter.TestcontainersExtension.lambda$startContainers$5(TestcontainersExtension.java:83)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
at org.testcontainers.junit.jupiter.TestcontainersExtension.startContainers(TestcontainersExtension.java:83)
at org.testcontainers.junit.jupiter.TestcontainersExtension.beforeAll(TestcontainersExtension.java:57)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
[INFO] Running com.ankurm.tutorials.junit.testcontainers2.GenericContainerNoLongerImplementsTestRuleTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.197 s -- in com.ankurm.tutorials.junit.testcontainers2.GenericContainerNoLongerImplementsTestRuleTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] NewPostgresContainerSkipsCleanlyTest.initializationError ? IllegalState Could not find a valid Docker environment. Please see logs and check configuration
[INFO]
[ERROR] Tests run: 3, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.778 s
[INFO] Finished at: 2026-10-08T18:46:46+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.6.0:test (default-test) on project testcontainers2:
[ERROR]
[ERROR] See /home/claude/JUnit_Tutorials/testcontainers2/target/surefire-reports for the individual test results.
[ERROR] See dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
@@ -0,0 +1,48 @@
# unzipped from testcontainers-1.21.4.jar
$ javap -p org/testcontainers/containers/GenericContainer.class
public class org.testcontainers.containers.GenericContainer<SELF extends org.testcontainers.containers.GenericContainer<SELF>>
extends org.testcontainers.containers.FailureDetectingExternalResource
implements org.testcontainers.containers.Container<SELF>, java.lang.AutoCloseable,
org.testcontainers.containers.wait.strategy.WaitStrategyTarget,
org.testcontainers.lifecycle.Startable {
...
}
$ javap -p org/testcontainers/containers/FailureDetectingExternalResource.class
public class org.testcontainers.containers.FailureDetectingExternalResource
implements org.junit.rules.TestRule {
public org.testcontainers.containers.FailureDetectingExternalResource();
...
}
# So in 1.21.4: GenericContainer -> FailureDetectingExternalResource -> implements TestRule.
# Every container class is a JUnit 4 TestRule by inheritance, with no extra dependency.
# unzipped from testcontainers-2.0.5.jar instead
$ javap -p org/testcontainers/containers/GenericContainer.class
public class org.testcontainers.containers.GenericContainer<SELF extends org.testcontainers.containers.GenericContainer<SELF>>
implements org.testcontainers.containers.Container<SELF>, java.lang.AutoCloseable,
org.testcontainers.containers.wait.strategy.WaitStrategyTarget,
org.testcontainers.lifecycle.Startable {
...
}
# No "extends FailureDetectingExternalResource" at all - that class and the TestRule contract
# it carried are both gone from the 2.0.5 jar. Confirmed exhaustively, not just for this one
# class:
$ mkdir ext2 && cd ext2 && unzip -oq ../testcontainers-2.0.5.jar
$ grep -rl "org/junit/rules/TestRule" . --include="*.class" | wc -l
0
# Compare: the same search against the 1.21.4 jar
$ mkdir ext1 && cd ext1 && unzip -oq ../testcontainers-1.21.4.jar
$ grep -rl "org/junit/rules/TestRule" . --include="*.class" | wc -l
2
# Zero classes anywhere in the 2.0.5 core jar reference org.junit.rules.TestRule. This is not a
# deprecation - the interface implementation is physically absent from the compiled jar. It is
# also why the fix is not "add the testcontainers-junit-jupiter dependency": that artifact is a
# JUnit 5 extension (@Testcontainers/@Container), not a JUnit 4 rule shim. There is no JUnit 4
# path forward in 2.0 - see GitHub release notes, testcontainers-java#10805 "Remove JUnit 4
# support" and #10808 "Fix missing junit4 leftovers", https://github.com/testcontainers/testcontainers-java/releases/tag/2.0.0
@@ -0,0 +1,37 @@
# unzipped from testcontainers-1.21.4.jar
$ javap -v -p org/testcontainers/dockerclient/DockerClientProviderStrategy.class
...
#773 = Utf8 Fallback to Docker API version 1.32.
#774 = String #773 // Fallback to Docker API version 1.32.
#775 = Utf8 VERSION_1_32
#777 = Fieldref org/testcontainers/shaded/com/github/dockerjava/core/RemoteApiVersion.VERSION_1_32:...
...
273: ldc_w #774 // String Fallback to Docker API version 1.32.
286: getstatic #777 // Field ...RemoteApiVersion.VERSION_1_32:...
# unzipped from testcontainers-2.0.5.jar instead
$ javap -v -p org/testcontainers/dockerclient/DockerClientProviderStrategy.class
...
#742 = Utf8 VERSION_1_44
#744 = Fieldref org/testcontainers/shaded/com/github/dockerjava/core/RemoteApiVersion.VERSION_1_44:...
#764 = Utf8 Pinging Docker API version 1.44.
#765 = String #764 // Pinging Docker API version 1.44.
...
208: getstatic #744 // Field ...RemoteApiVersion.VERSION_1_44:...
244: ldc_w #765 // String Pinging Docker API version 1.44.
# The hardcoded default Docker Engine API version this client falls back to moved from 1.32 to
# 1.44 somewhere between 1.21.4 and 2.0.5. The release notes for 2.0.2 say exactly that:
# "Set default docker API version to 1.44 (#11216) @eddumelendez" -
# https://github.com/testcontainers/testcontainers-java/releases/tag/2.0.2
#
# This is not a cosmetic bump. Docker Engine 29 (shipped inside Docker Desktop 4.52) raises its
# own *minimum accepted* client API version to 1.44, and rejects anything older outright:
# "client version 1.32 is too old. Minimum supported API version is 1.44, please upgrade
# your client to a newer version."
# reported against Testcontainers 1.21.3 in
# https://github.com/testcontainers/testcontainers-java/issues/11235 - closed as a duplicate,
# with multiple commenters confirming Testcontainers 2.0.2 works against the same Docker Desktop
# version where 1.21.x fails outright. A project pinned to the 1.x line has three options: set
# api.version=1.44 by hand in a ~/.docker-java.properties file, keep Docker Engine below 29, or move
# to 2.0.2+, where this is just the default.
@@ -0,0 +1,43 @@
Module: /tmp/legacy-check (a throwaway Maven project, not part of this repo - built only to
capture these two transcripts; see the post for why).
pom.xml dependencies at this point:
junit:junit:4.13.2
org.testcontainers:testcontainers:1.21.4
org.testcontainers:postgresql:1.21.4
src/test/java/com/ankurm/legacy/ClassicJUnit4RuleTest.java:
@ClassRule
public static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:17");
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.ankurm:legacy-check >-----------------------
[INFO] Building legacy-check 1.0.0
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ legacy-check ---
[INFO] Deleting /tmp/post46/legacy-check/target
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ legacy-check ---
[INFO] skip non existing resourceDirectory /tmp/post46/legacy-check/src/main/resources
[INFO]
[INFO] --- compiler:3.13.0:compile (default-compile) @ legacy-check ---
[INFO] No sources to compile
[INFO]
[INFO] --- resources:3.3.1:testResources (default-testResources) @ legacy-check ---
[INFO] skip non existing resourceDirectory /tmp/post46/legacy-check/src/test/resources
[INFO]
[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ legacy-check ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 1 source file with javac [debug target 21] to target/test-classes
[WARNING] location of system modules is not set in conjunction with -source 21
not setting the location of system modules may lead to class files that cannot run on JDK 21
--release 21 is recommended instead of -source 21 -target 21 because it sets the location of system modules automatically
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.016 s
[INFO] Finished at: 2026-10-08T18:40:55+05:30
[INFO] ------------------------------------------------------------------------
@@ -0,0 +1,36 @@
Same module, same source file, zero code changes. The ONLY edit between this run and
04-legacy-pom-compiles-under-1.21.4.txt is the version property:
- <testcontainers.version>1.21.4</testcontainers.version>
+ <testcontainers.version>2.0.5</testcontainers.version>
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.ankurm:legacy-check >-----------------------
[INFO] Building legacy-check 1.0.0
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.20/jackson-annotations-2.20.pom
Progress (1): 952 B␍Progress (1): 2.3 kB␍Progress (1): 3.8 kB␍Progress (1): 6.4 kB␍Progress (1): 7.0 kB␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.20/jackson-annotations-2.20.pom (7.0 kB at 15 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/testcontainers/postgresql/2.0.5/postgresql-2.0.5.pom
[WARNING] The POM for org.testcontainers:postgresql:jar:2.0.5 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.20/jackson-annotations-2.20.jar
Progress (1): 7.7/79 kB␍Progress (1): 8.2/79 kB␍Progress (1): 25/79 kB ␍Progress (1): 41/79 kB␍Progress (1): 49/79 kB␍Progress (1): 57/79 kB␍Progress (1): 66/79 kB␍Progress (1): 74/79 kB␍Progress (1): 79 kB ␍ ␍Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.20/jackson-annotations-2.20.jar (79 kB at 990 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/testcontainers/postgresql/2.0.5/postgresql-2.0.5.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.299 s
[INFO] Finished at: 2026-10-08T18:41:04+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project legacy-check: Could not resolve dependencies for project com.ankurm:legacy-check:jar:1.0.0
[ERROR] dependency: org.testcontainers:postgresql:jar:2.0.5 (compile)
[ERROR] Could not find artifact org.testcontainers:postgresql:jar:2.0.5 in central (https://repo.maven.apache.org/maven2)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
@@ -0,0 +1,47 @@
$ curl -sS https://repo1.maven.org/maven2/org/testcontainers/junit-jupiter/maven-metadata.xml
<metadata>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<versioning>
<latest>1.21.4</latest>
<release>1.21.4</release>
<versions>
... (1.10.0 through 1.21.4, 56 releases total) ...
<version>1.21.4</version>
</versions>
<lastUpdated>20251216004330</lastUpdated>
</versioning>
</metadata>
$ curl -sS https://repo1.maven.org/maven2/org/testcontainers/testcontainers-junit-jupiter/maven-metadata.xml
<metadata>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-junit-jupiter</artifactId>
<versioning>
<latest>2.0.5</latest>
<release>2.0.5</release>
<versions>
<version>2.0.0</version>
<version>2.0.1</version>
<version>2.0.2</version>
<version>2.0.3</version>
<version>2.0.4</version>
<version>2.0.5</version>
</versions>
<lastUpdated>20260420182027</lastUpdated>
</versioning>
</metadata>
# The old artifactId's release history simply stops at 1.21.4 - no 2.x version was ever
# published under org.testcontainers:junit-jupiter. The new artifactId's history starts fresh
# at 2.0.0. This is the real, permanent fork point on Maven Central: "upgrade the version
# number" on your existing <artifactId>junit-jupiter</artifactId> dependency has no 2.x version
# to resolve to - it will stay on 1.21.4 forever, or fail outright for a module whose own
# artifactId was retired rather than just renamed (see 05-legacy-pom-fails-to-resolve-under-2.0.5.txt,
# where this happens to org.testcontainers:postgresql).
#
# This is one rename out of 61: OpenRewrite's own migration recipe documents the full list at
# https://docs.openrewrite.org/recipes/java/testing/testcontainers/testcontainers2dependencies -
# every org.testcontainers:<module> artifact gets a testcontainers-<module> artifactId, same
# groupId, same Maven Central repository. The core artifact, plain org.testcontainers:testcontainers,
# is the one name on the list that did NOT change.