diff --git a/build.gradle b/build.gradle index 82d6eeef96..ae3e8f196e 100644 --- a/build.gradle +++ b/build.gradle @@ -421,43 +421,55 @@ allprojects { configurations { all { resolutionStrategy { - // Force dependencies to use the same version of Kotlin as Corda. - force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - force "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - - // Force dependencies to use the same version of Guava as Corda. - force "com.google.guava:guava:$guava_version" - // Demand that everything uses our given version of Netty. eachDependency { details -> if (details.requested.group == 'io.netty' && details.requested.name.startsWith('netty-')) { - if (details.requested.name.startsWith('netty-tcnative')){ + if (details.requested.name.startsWith('netty-tcnative')) { details.useVersion tcnative_version } else { details.useVersion netty_version } } } + + dependencySubstitution { + // We want to use SLF4J's version of these bindings: jcl-over-slf4j + // Remove any transitive dependency on Apache's version. + substitute module('commons-logging:commons-logging') with module("org.slf4j:jcl-over-slf4j:$slf4j_version") + + // Remove any transitive dependency on Logback (e.g. Liquibase 3.6 introduces this dependency) + substitute module('ch.qos.logback:logback-classic') with module("org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version") + + // Netty-All is an uber-jar which contains every Netty module. + // Exclude it to force us to use the individual Netty modules instead. + substitute module('io.netty:netty-all') with module("io.netty:netty-common:$netty_version") + + // Force dependencies to use the same version of Guava as Corda. + substitute module('com.google.guava:guava') with module("com.google.guava:guava:$guava_version") + + // Effectively delete this unused and unwanted transitive dependency of Artemis. + substitute module('org.jgroups:jgroups') with module("org.apache.activemq:artemis-commons:$artemis_version") + } } } - compile { - // We want to use SLF4J's version of these bindings: jcl-over-slf4j - // Remove any transitive dependency on Apache's version. - exclude group: 'commons-logging', module: 'commons-logging' - // Remove any transitive dependency on Logback (e.g. Liquibase 3.6 introduces this dependency) - exclude group: 'ch.qos.logback' - // Netty-All is an uber-jar which contains every Netty module. - // Exclude it to force us to use the individual Netty modules instead. - exclude group: 'io.netty', module: 'netty-all' - } - runtime { - // We never want isolated.jar on classPath, since we want to test jar being dynamically loaded as an attachment - exclude module: 'isolated' + // Select all of the compileClasspath and runtimeClasspath etc configurations, + // but NOT the "classpath" configuration, as that is used by the Gradle plugins. + matching { it.name.endsWith("Classpath") }.configureEach { cfg -> + cfg.resolutionStrategy { + dependencySubstitution { + // Force dependencies to use the same version of Kotlin as Corda. + substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk8') with module("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version") + substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk7') with module("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") + substitute module('org.jetbrains.kotlin:kotlin-stdlib-common') with module("org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version") + substitute module('org.jetbrains.kotlin:kotlin-stdlib') with module("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") + substitute module('org.jetbrains.kotlin:kotlin-reflect') with module("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") + } + } } } } + sonarqube { properties { property "sonar.projectName", "Corda" diff --git a/settings.gradle b/settings.gradle index 97dfbdd783..18cc562f45 100644 --- a/settings.gradle +++ b/settings.gradle @@ -31,7 +31,6 @@ rootProject.name = 'corda-project' include 'confidential-identities' include 'finance:contracts' include 'finance:workflows' -include 'isolated' include 'core' include 'core-tests' include 'docs'