I am creating a MySQLContainer with an init script
public static MySQLContainer mysql = (MySQLContainer) new MySQLContainer().withInitScript("sql/create_schema.sql");
This results in the following exception
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 24 more
This instantiation worked fine on 1.10.7
I checked with Slack and they suggested I report this as the shading changing in 1.11
Thanks for reporting!
Meanwhile, you should be able to workaround it by adding 'org.apache.commons:commons-lang3:3.8.1' dependency.
commons lang 3.8.1 doesn't works, commons lang 2.6 is right
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
@robfrank you're right, my bad! 馃憤
to sort this completely, I needed to add commons-io as well
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<scope>test</scope>
</dependency>
We were able to find the cause and fix it in #1390.
We will try to verify it ourselves, but would appreciate if somebody here can try it with their projects to verify that now it works correctly, with Jitpack or by installing locally.
Switched to:
<dependency>
<groupId>com.github.testcontainers</groupId>
<artifactId>testcontainers-java</artifactId>
<version>-SNAPSHOT</version>
</dependency>

No more class loader error!
Umm...I don't think that's the right dependency (1.2.1 makes me think so).
Could you please try:
com.github.testcontainers.testcontainers-java:testcontainers:master-SNAPSHOT
and:
com.github.testcontainers.testcontainers-java:mysql:master-SNAPSHOT
Ok second try using master-SNAPSHOT.. still no class loader error!

Most helpful comment
to sort this completely, I needed to add commons-io as well