mirror of
https://github.com/corda/corda.git
synced 2024-12-29 09:18:58 +00:00
Shade the zookeeper libraries to avoid version conflicts
Add comment to explain gradle logic
This commit is contained in:
parent
84ca67a5e3
commit
1c169d035a
@ -7,7 +7,9 @@
|
|||||||
*
|
*
|
||||||
* Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
|
* Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
|
||||||
*/
|
*/
|
||||||
|
plugins {
|
||||||
|
id "com.github.johnrengelman.shadow" version "2.0.3"
|
||||||
|
}
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
apply plugin: 'net.corda.plugins.quasar-utils'
|
apply plugin: 'net.corda.plugins.quasar-utils'
|
||||||
apply plugin: 'net.corda.plugins.publish-utils'
|
apply plugin: 'net.corda.plugins.publish-utils'
|
||||||
@ -52,7 +54,8 @@ dependencies {
|
|||||||
runtime 'com.mattbertolini:liquibase-slf4j:2.0.0'
|
runtime 'com.mattbertolini:liquibase-slf4j:2.0.0'
|
||||||
|
|
||||||
// Apache Curator: a client library for Zookeeper
|
// Apache Curator: a client library for Zookeeper
|
||||||
compile "org.apache.curator:curator-recipes:${curator_version}"
|
shadow "org.apache.curator:curator-recipes:${curator_version}"
|
||||||
|
testCompile configurations.shadow // need to look at rewritten classes
|
||||||
testCompile "org.apache.curator:curator-test:${curator_version}"
|
testCompile "org.apache.curator:curator-test:${curator_version}"
|
||||||
|
|
||||||
// FastClasspathScanner: classpath scanning - needed for the NetworkBootstraper
|
// FastClasspathScanner: classpath scanning - needed for the NetworkBootstraper
|
||||||
@ -76,6 +79,31 @@ configurations {
|
|||||||
testArtifacts.extendsFrom testRuntime
|
testArtifacts.extendsFrom testRuntime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
baseName 'corda-node-api'
|
||||||
|
}
|
||||||
|
// ensure that immediately after jar step we update to the shaded version of the jar, so that everyone use it.
|
||||||
|
jar.finalizedBy shadowJar
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
baseName jar.baseName
|
||||||
|
configurations = [project.configurations.shadow]
|
||||||
|
classifier ""
|
||||||
|
dependencies {
|
||||||
|
include(dependency("org.apache.curator:curator-recipes:${curator_version}"))
|
||||||
|
include(dependency('org.apache.zookeeper:zookeeper:3.5.3-beta'))
|
||||||
|
include(dependency('commons-cli:commons-cli:1.2'))
|
||||||
|
include(dependency('io.netty:netty:3.10.5.Final'))
|
||||||
|
include(dependency('com.google.guava:guava:20.0'))
|
||||||
|
}
|
||||||
|
relocate 'org.apache.curator.', 'net.corda.shaded.org.apache.curator.'
|
||||||
|
relocate 'org.apache.zookeeper.', 'net.corda.shaded.org.apache.zookeeper.'
|
||||||
|
relocate 'org.apache.jute.', 'net.corda.shaded.org.apache.jute.'
|
||||||
|
relocate 'org.apache.commons.', 'net.corda.shaded.org.apache.commons.'
|
||||||
|
relocate 'org.jboss.netty.', 'net.corda.shaded.org.jboss.netty.'
|
||||||
|
relocate 'com.google.', 'net.corda.shaded.com.google.'
|
||||||
|
}
|
||||||
|
|
||||||
task testJar(type: Jar) {
|
task testJar(type: Jar) {
|
||||||
classifier "tests"
|
classifier "tests"
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
@ -85,10 +113,6 @@ artifacts {
|
|||||||
testArtifacts testJar
|
testArtifacts testJar
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
|
||||||
baseName 'corda-node-api'
|
|
||||||
}
|
|
||||||
|
|
||||||
publish {
|
publish {
|
||||||
name jar.baseName
|
name shadowJar.baseName
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user