Skip to content

Commit

Permalink
Fixed provided but shaded dependencies in modules by configuring a gl…
Browse files Browse the repository at this point in the history
…obal shading rule (#693)
  • Loading branch information
bsideup authored May 15, 2018
1 parent 469136e commit a36451e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 32 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## UNRELEASED
### Fixed
- Fix for setting `ryuk.container.timeout` causes a `ClassCastException` ([\#684](https://github.com/testcontainers/testcontainers-java/issues/684))
- Fixed provided but shaded dependencies in modules ([\#693](https://github.com/testcontainers/testcontainers-java/issues/693))

### Changed

Expand Down
37 changes: 37 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ subprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'io.franzbecker.gradle-lombok'
apply plugin: 'com.github.johnrengelman.shadow'
apply from: "$rootDir/gradle/publishing.gradle"
apply from: "$rootDir/gradle/bintray.gradle"

Expand Down Expand Up @@ -49,6 +50,42 @@ subprojects {
jcenter()
}

shadowJar {
configurations = []
classifier = null

relocate('META-INF/native/libnetty', 'META-INF/native/liborg-testcontainers-shaded-netty')

[
"org.apache.http",
"org.apache.commons.lang",
"org.apache.commons.io",
"org.apache.commons.codec",
"org.glassfish",
"org.aopalliance",
"org.jvnet",
"javax.annotation",
"javax.inject",
"javax.ws.rs",
"com.fasterxml.jackson",
"jersey.repackaged",
"com.google",
"io.netty",
"org.bouncycastle",
"org.newsclub",
"org.zeroturnaround"
].each { relocate(it, "org.testcontainers.shaded.$it") }
}

publishing {
publications {
mavenJava(MavenPublication) { publication ->
artifacts.removeAll { it.classifier == null }
artifact project.tasks.shadowJar
}
}
}

dependencies {
testCompile 'ch.qos.logback:logback-classic:1.2.3'
}
Expand Down
32 changes: 0 additions & 32 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ apply plugin: 'com.github.johnrengelman.shadow'

description = "Testcontainers Core"

publishing {
publications {
mavenJava(MavenPublication) { publication ->
artifacts.removeAll { it.classifier == null }
artifact project.tasks.shadowJar
}
}
}

sourceSets {
jarFileTest
}
Expand All @@ -24,7 +15,6 @@ configurations {

shadowJar {
configurations = [project.configurations.shaded]
classifier = null

mergeServiceFiles()

Expand All @@ -46,28 +36,6 @@ shadowJar {
'mozilla/public-suffix-list.txt',
].each { exclude(it) }

relocate('META-INF/native/libnetty', 'META-INF/native/liborg-testcontainers-shaded-netty')

[
"org.apache.http",
"org.apache.commons.lang",
"org.apache.commons.io",
"org.apache.commons.codec",
"org.glassfish",
"org.aopalliance",
"org.jvnet",
"javax.annotation",
"javax.inject",
"javax.ws.rs",
"com.fasterxml.jackson",
"jersey.repackaged",
"com.google",
"io.netty",
"org.bouncycastle",
"org.newsclub",
"org.zeroturnaround"
].each { relocate(it, "org.testcontainers.shaded.$it") }

dependencies {
include(dependency('org.apache.httpcomponents:.*'))
include(dependency('org.glassfish.*:.*'))
Expand Down

0 comments on commit a36451e

Please sign in to comment.