From d0b62db0d2dce31958ef0611d8e076845819aca8 Mon Sep 17 00:00:00 2001 From: josecoll Date: Wed, 17 Jan 2018 16:02:10 +0000 Subject: [PATCH] Backported fix. (#2378) --- .../src/main/kotlin/net/corda/plugins/Cordformation.kt | 3 ++- .../cordformation/src/main/kotlin/net/corda/plugins/Node.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Cordformation.kt b/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Cordformation.kt index 26878fa357..43444ca270 100644 --- a/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Cordformation.kt +++ b/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Cordformation.kt @@ -55,7 +55,8 @@ class Cordformation : Plugin { override fun apply(project: Project) { Utils.createCompileConfiguration("cordapp", project) Utils.createRuntimeConfiguration(CORDFORMATION_TYPE, project) - val jolokiaVersion = project.rootProject.ext("jolokia_version") + // TODO: improve how we re-use existing declared external variables from root gradle.build + val jolokiaVersion = try { project.rootProject.ext("jolokia_version") } catch (e: Exception) { "1.3.7" } project.dependencies.add(CORDFORMATION_TYPE, "org.jolokia:jolokia-jvm:$jolokiaVersion:agent") } } diff --git a/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Node.kt b/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Node.kt index e5397ad5aa..1f0cdc9701 100644 --- a/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Node.kt +++ b/gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Node.kt @@ -127,7 +127,8 @@ class Node(private val project: Project) : CordformNode() { * Installs the jolokia monitoring agent JAR to the node/drivers directory */ private fun installAgentJar() { - val jolokiaVersion = project.rootProject.ext("jolokia_version") + // TODO: improve how we re-use existing declared external variables from root gradle.build + val jolokiaVersion = try { project.rootProject.ext("jolokia_version") } catch (e: Exception) { "1.3.7" } val agentJar = project.configuration("runtime").files { (it.group == "org.jolokia") && (it.name == "jolokia-jvm") &&