Skip to content

Commit 22339fc

Browse files
authored
Fix Guava shading in jdbc module (#399)
* Fix Guava shading in jdbc module * fix shading tests
1 parent 8707770 commit 22339fc

File tree

5 files changed

+68
-13
lines changed

5 files changed

+68
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
33

44
## UNRELEASED
55
### Fixed
6+
- Fixed Guava shading in `jdbc` module
67

78
### Changed
89

core/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
<name>TestContainers Core</name>
1616

1717
<dependencies>
18+
<dependency>
19+
<groupId>junit</groupId>
20+
<artifactId>junit</artifactId>
21+
<version>4.12</version>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>org.slf4j</groupId>
26+
<artifactId>slf4j-api</artifactId>
27+
<version>1.7.25</version>
28+
</dependency>
29+
1830
<dependency>
1931
<groupId>com.github.docker-java</groupId>
2032
<artifactId>docker-java</artifactId>

modules/jdbc/pom.xml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,53 @@
2222
<groupId>com.google.guava</groupId>
2323
<artifactId>guava</artifactId>
2424
<version>18.0</version>
25-
<scope>provided</scope>
2625
</dependency>
2726
</dependencies>
2827

28+
<build>
29+
<plugins>
30+
<plugin>
31+
<artifactId>maven-shade-plugin</artifactId>
32+
<version>3.0.0</version>
33+
<executions>
34+
<execution>
35+
<phase>package</phase>
36+
<goals>
37+
<goal>shade</goal>
38+
</goals>
39+
</execution>
40+
</executions>
41+
<configuration>
42+
<relocations>
43+
<relocation>
44+
<pattern>com.google</pattern>
45+
<shadedPattern>org.testcontainers.shaded.com.google</shadedPattern>
46+
</relocation>
47+
</relocations>
48+
<artifactSet>
49+
<includes>
50+
<include>com.google.guava:*</include>
51+
</includes>
52+
</artifactSet>
53+
<promoteTransitiveDependencies>false</promoteTransitiveDependencies>
54+
<shadedArtifactAttached>false</shadedArtifactAttached>
55+
<filters>
56+
<filter>
57+
<artifact>*:*</artifact>
58+
<excludes>
59+
<exclude>META-INF/NOTICE</exclude>
60+
<exclude>META-INF/LICENSE</exclude>
61+
<exclude>META-INF/DEPENDENCIES</exclude>
62+
<exclude>META-INF/maven/</exclude>
63+
<exclude>META-INF/*.SF</exclude>
64+
<exclude>META-INF/*.DSA</exclude>
65+
<exclude>META-INF/*.RSA</exclude>
66+
</excludes>
67+
</filter>
68+
</filters>
69+
</configuration>
70+
</plugin>
71+
</plugins>
72+
</build>
73+
2974
</project>

pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@
6969
</developers>
7070

7171
<dependencies>
72-
<dependency>
73-
<groupId>junit</groupId>
74-
<artifactId>junit</artifactId>
75-
<version>4.12</version>
76-
</dependency>
77-
7872
<!-- Project lombok for additional safety/convenience support -->
7973
<dependency>
8074
<groupId>org.projectlombok</groupId>
@@ -83,12 +77,6 @@
8377
<scope>provided</scope>
8478
</dependency>
8579

86-
<!-- Test dependencies -->
87-
<dependency>
88-
<groupId>org.slf4j</groupId>
89-
<artifactId>slf4j-api</artifactId>
90-
<version>1.7.25</version>
91-
</dependency>
9280
<dependency>
9381
<groupId>ch.qos.logback</groupId>
9482
<artifactId>logback-classic</artifactId>

shade-test/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,13 @@
1919
<module>service-lookup-dropwizard</module>
2020
<module>jar-file</module>
2121
</modules>
22+
23+
<dependencies>
24+
<dependency>
25+
<groupId>junit</groupId>
26+
<artifactId>junit</artifactId>
27+
<version>4.12</version>
28+
<scope>test</scope>
29+
</dependency>
30+
</dependencies>
2231
</project>

0 commit comments

Comments
 (0)