From af75a05502bfef29f54a9285211062b408667268 Mon Sep 17 00:00:00 2001 From: Anthony Keenan Date: Thu, 20 Dec 2018 12:31:16 +0000 Subject: [PATCH] Fix irs-demo dependency issues (#4438) * Fix irs-demo dependency issues * Fixed a problem with the IRS demo test JAR. * Fixed deployNodes problem and log4j info statement. --- samples/irs-demo/README.md | 2 +- samples/irs-demo/cordapp/build.gradle | 13 +++- samples/irs-demo/web/build.gradle | 11 ++-- .../web/src/main/resources/log4j2.xml | 60 +++++++++++++++++++ testing/test-common/build.gradle | 1 + tools/cliutils/build.gradle | 4 +- 6 files changed, 81 insertions(+), 10 deletions(-) create mode 100644 samples/irs-demo/web/src/main/resources/log4j2.xml diff --git a/samples/irs-demo/README.md b/samples/irs-demo/README.md index 9a11c0236b..f73cca5caa 100644 --- a/samples/irs-demo/README.md +++ b/samples/irs-demo/README.md @@ -13,7 +13,7 @@ To run from the command line in Unix: 2. Run ``./gradlew samples:irs-demo:web:deployWebapps`` to install configs and tools for running webservers 3. Move to the ``samples/irs-demo/`` directory 4. Run ``./cordapp/build/nodes/runnodes`` to open up three new terminals with the three nodes (you may have to install xterm) -5. On Linux, run ``./web/build/webapps/runwebapps`` to open three more terminals for associated webservers. On macOS, +5. On Linux, run ``./web/build/webapps/runwebapps.sh`` to open three more terminals for associated webservers. On macOS, use the following command instead: ``osascript ./web/build/webapps/runwebapps.scpt`` To run from the command line in Windows: diff --git a/samples/irs-demo/cordapp/build.gradle b/samples/irs-demo/cordapp/build.gradle index 35bb49933d..0230897346 100644 --- a/samples/irs-demo/cordapp/build.gradle +++ b/samples/irs-demo/cordapp/build.gradle @@ -31,12 +31,13 @@ dependencies { // Corda integration dependencies cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts') cordaCompile project(':core') + cordaRuntime project(':node-api') // Cordapp dependencies // Specify your cordapp's dependencies below, including dependent cordapps compile group: 'commons-io', name: 'commons-io', version: '2.5' - cordaCompile project(':node-driver') + testCompile project(':node-driver') testCompile "junit:junit:$junit_version" testCompile "org.assertj:assertj-core:${assertj_version}" } @@ -164,12 +165,18 @@ idea { } jar { - from sourceSets.test.output + from sourceSets.main.output duplicatesStrategy = DuplicatesStrategy.EXCLUDE } +task testJar(type: Jar) { + classifier "test" + from sourceSets.main.output + from sourceSets.test.output +} + artifacts { - demoArtifacts jar + demoArtifacts testJar } cordapp { diff --git a/samples/irs-demo/web/build.gradle b/samples/irs-demo/web/build.gradle index d79abbbc92..475d148ee8 100644 --- a/samples/irs-demo/web/build.gradle +++ b/samples/irs-demo/web/build.gradle @@ -17,7 +17,6 @@ buildscript { import org.yaml.snakeyaml.DumperOptions - plugins { id 'com.craigburke.client-dependencies' version '1.4.0' } @@ -66,11 +65,15 @@ dependencies { exclude module: "spring-boot-starter-logging" exclude module: "logback-classic" } + compile('org.springframework.boot:spring-boot-starter-log4j2') + runtime("org.apache.logging.log4j:log4j-web:$log4j_version") compile("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version") compile project(":client:rpc") compile project(":client:jackson") - compile project(":test-utils") - compile project(path: ":samples:irs-demo:cordapp", configuration: "demoArtifacts") + compile project(":samples:irs-demo:cordapp") + + testCompile project(":test-utils") + testCompile project(path: ":samples:irs-demo:cordapp", configuration: "demoArtifacts") // JOpt: for command line flags. compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version" @@ -82,7 +85,7 @@ dependencies { } jar { - from sourceSets.test.output + from sourceSets.main.output dependsOn clientInstall } diff --git a/samples/irs-demo/web/src/main/resources/log4j2.xml b/samples/irs-demo/web/src/main/resources/log4j2.xml new file mode 100644 index 0000000000..1c4164a050 --- /dev/null +++ b/samples/irs-demo/web/src/main/resources/log4j2.xml @@ -0,0 +1,60 @@ + + + + + logs + node-${hostName} + ${log-path}/archive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/test-common/build.gradle b/testing/test-common/build.gradle index 838a700abc..9044d46319 100644 --- a/testing/test-common/build.gradle +++ b/testing/test-common/build.gradle @@ -5,6 +5,7 @@ apply plugin: 'com.jfrog.artifactory' dependencies { compile project(':core') compile project(':node-api') + compile project(':tools:cliutils') // Unit testing helpers. compile "junit:junit:$junit_version" diff --git a/tools/cliutils/build.gradle b/tools/cliutils/build.gradle index d505751347..0044b66fe2 100644 --- a/tools/cliutils/build.gradle +++ b/tools/cliutils/build.gradle @@ -21,10 +21,10 @@ dependencies { } jar { - baseName = "cliutils" + baseName = "corda-tools-cliutils" } publish { - name 'corda-tools-cliutils' + name jar.baseName }