Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct shading for netty native linux lib; add guava shading and fix bouncycastle certs #181

Merged
merged 3 commits into from
Jul 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file.

## [1.1.2] - 2016-07-19
### Fixed
- Fix shading of netty Linux native libs

### Changed
- Shade guava artifacts to prevent classloader conflicts

## [1.1.1] - 2016-07-17
### Fixed
- Improve shutdown of unnecessary docker clients (#170)
Expand Down Expand Up @@ -153,6 +160,7 @@ All notable changes to this project will be documented in this file.
## [0.9] - 2015-04-29
Initial release

[1.1.2]: https://github.com/testcontainers/testcontainers-java/releases/tag/testcontainers-1.1.2
[1.1.1]: https://github.com/testcontainers/testcontainers-java/releases/tag/testcontainers-1.1.1
[1.1.0]: https://github.com/testcontainers/testcontainers-java/releases/tag/testcontainers-1.1.0
[1.0.5]: https://github.com/testcontainers/testcontainers-java/releases/tag/testcontainers-1.0.5
Expand Down
33 changes: 33 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,18 @@
<pattern>jersey.repackaged</pattern>
<shadedPattern>org.testcontainers.shaded.jersey.repackaged</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.common</pattern>
<shadedPattern>org.testcontainers.shaded.com.google.common</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>org.testcontainers.shaded.io.netty</shadedPattern>
</relocation>
<relocation>
<pattern>org.bouncycastle</pattern>
<shadedPattern>org.testcontainers.shaded.org.bouncycastle</shadedPattern>
</relocation>
</relocations>
<artifactSet>
<includes>
Expand All @@ -162,7 +170,9 @@
<include>javax.ws.rs:*</include>
<include>com.fasterxml.*:*</include>
<include>com.github.docker-java:*</include>
<include>com.google.guava:*</include>
<include>io.netty:*</include>
<include>org.bouncycastle:*</include>
</includes>
</artifactSet>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
Expand All @@ -184,6 +194,29 @@
</filters>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<configuration>
<target>
<echo message="unjar" />
<unzip src="${project.build.directory}/${project.artifactId}-${project.version}.jar" dest="${project.build.directory}/exploded/" />
<move file="${project.build.directory}/exploded/META-INF/native/libnetty-transport-native-epoll.so"
tofile="${project.build.directory}/exploded/META-INF/native/liborg-testcontainers-shaded-netty-transport-native-epoll.so" />
<jar destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar" basedir="${project.build.directory}/exploded" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public class GenericContainer<SELF extends GenericContainer<SELF>>

public static final int CONTAINER_RUNNING_TIMEOUT_SEC = 30;

static {
System.setProperty("org.testcontainers.shaded.io.netty.packagePrefix", "org.testcontainers.shaded.");
}

/*
* Default settings
*/
Expand Down
48 changes: 48 additions & 0 deletions modules/jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,53 @@
<artifactId>testcontainers</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<relocations>
<relocation>
<pattern>com.google.common</pattern>
<shadedPattern>org.testcontainers.shaded.com.google.common</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>org.bouncycastle:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<artifactSet>
<excludes>
<exclude>com.google.guava:*</exclude>
</excludes>
</artifactSet>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<shadedArtifactAttached>false</shadedArtifactAttached>
</configuration>
</plugin>
</plugins>
</build>
</project>
49 changes: 49 additions & 0 deletions modules/selenium/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<scope>provided</scope>
</dependency>

<!-- WebDriver dependency as 'provided' scope -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
Expand All @@ -34,4 +41,46 @@
<version>6.1.25</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<relocations>
<relocation>
<pattern>com.google.common</pattern>
<shadedPattern>org.testcontainers.shaded.com.google.common</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>org.bouncycastle:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<artifactSet>
<excludes>
<exclude>com.google.guava:*</exclude>
</excludes>
</artifactSet>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<shadedArtifactAttached>false</shadedArtifactAttached>
</configuration>
</plugin>
</plugins>
</build>
</project>