本文介绍了CordApp的传递依存关系未更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

原始问题.如何更新cordApp的传递依赖关系以使用Artemis 2.5.0.我正在关注 corda-ftp演示.如下所示更新了build.gradle.当我进行 gradle依赖时,我看到Artemis 2.5.0获胜,但是以某种方式,节点选择了2.2.0,正如我在节点日志的 classpath 中所看到的那样.

original question. How do I update the transitive dependency of cordApp to use Artemis 2.5.0. I'm following this corda-ftp demo. Updated the build.gradle as shown below. when I do gradle dependencies I see Artemis 2.5.0 wins but somehow the nodes pick up 2.2.0 as I can see in classpath in nodes logs.

    buildscript {
    ext.corda_release_version = '3.1-corda'
    ext.corda_gradle_plugins_version = '3.1.0'
    ext.quasar_version = '0.7.9'
    ext.junit_version = '4.12'
    ext.spring_boot_version = '2.0.2.RELEASE'
    ext.corda_release_group = 'net.corda'
    ext.kotlin_version = '1.1.60'

    ext.username = "corda"
    ext.password = "corda_initial_password"
    ext.client_port = 10009

    repositories {
        mavenLocal()
        mavenCentral()
        jcenter()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version"
        classpath "net.corda.plugins:cordformation:$corda_gradle_plugins_version"
        classpath "net.corda.plugins:quasar-utils:$corda_gradle_plugins_version"
        classpath "io.spring.gradle:dependency-management-plugin:1.0.5.RELEASE"

    }
}
repositories {
    mavenLocal()
    jcenter()
    mavenCentral()
    maven { url 'https://dl.bintray.com/kotlin/exposed' }
    maven { url 'https://jitpack.io' }
    maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
    maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-dev/' }
}

apply plugin: 'kotlin'
apply plugin: "io.spring.dependency-management"
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'

dependencyManagement {
    dependencies {
        dependencySet(group: 'org.apache.activemq', version: '2.5.0') {
            entry 'artemis-amqp-protocol'
            entry 'artemis-commons'
            entry 'artemis-core-client'
            entry 'artemis-jdbc-store'
            entry 'artemis-jms-client'
            entry 'artemis-journal'
            entry 'artemis-native'
            entry 'artemis-selector'
            entry 'artemis-server'
        }
    }
}

sourceSets {
    main {
        resources {
            srcDir "config/dev"
        }
    }
    test {
        resources {
            srcDir "config/test"
        }
    }
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
    testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
    testCompile "junit:junit:$junit_version"

    // Corda integration dependencies
    cordaCompile "$corda_release_group:corda-core:$corda_release_version"
    cordaCompile "$corda_release_group:corda-finance:$corda_release_version"
    cordaCompile "$corda_release_group:corda-jackson:$corda_release_version"
    cordaCompile "$corda_release_group:corda-rpc:$corda_release_version"
    cordaCompile "$corda_release_group:corda-node-api:$corda_release_version"
    cordaCompile "$corda_release_group:corda-webserver-impl:$corda_release_version"
    cordaRuntime "$corda_release_group:corda:$corda_release_version"
    cordaRuntime "$corda_release_group:corda-webserver:$corda_release_version"
    testCompile "$corda_release_group:corda-test-utils:$corda_release_version"
    testCompile "$corda_release_group:corda-node-driver:$corda_release_version"

    // GraphStream: For visualisation (required by TemplateClientRPC app)
    compile "org.graphstream:gs-core:1.3"
    compile("org.graphstream:gs-ui:1.3") {
        exclude group: "bouncycastle"
    }

    // CorDapp dependencies
    // Specify your cordapp's dependencies below, including dependent cordapps

    compile "io.reactivex:rxjava:1.2.4"
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
    kotlinOptions {
        languageVersion = "1.1"
        apiVersion = "1.1"
        jvmTarget = "1.8"
        javaParameters = true   // Useful for reflection.
    }
}

def copyConfigTask(nodeName) {
    return tasks.create("copy${nodeName}", Copy) {
        from "${nodeName}.json"
        into "./build/nodes/${nodeName}/"
        rename {
            "cordaftp.json"
        }
    }
}

task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', copyConfigTask("CorpA"), copyConfigTask("CorpB")]) {
    directory "./build/nodes"
    node {
        name "O=R3Corp,OU=corda,L=London,C=GB"
        notary = [validating : false]
        p2pPort 10002
        rpcSettings {
            address("localhost:10003")
            adminAddress("localhost:10043")
        }
        cordapps = []
    }
    node {
        name "O=CorpA,L=Paris,C=FR"
        p2pPort 10005
        rpcSettings {
            address("localhost:10006")
            adminAddress("localhost:10046")
        }
        extraConfig = [
                jvmArgs : [ "-Xmx1g"],
                attachmentContentCacheSizeMegaBytes: 100
        ]
        cordapps = []
        // TODO: Replace username / password with vars such that we can DRY the username, password
        rpcUsers = [[ "user": "corda", "password": "corda_initial_password", "permissions": ["ALL"]]]
    }
    node {
        name "O=CorpB,L=Rome,C=IT"
        p2pPort 10008
        rpcSettings {
            address("localhost:10009")
            adminAddress("localhost:10049")
        }
        extraConfig = [
                jvmArgs : [ "-Xmx1g"],
                attachmentContentCacheSizeMegaBytes: 100
        ]
        cordapps = []
        // TODO: Ditto
        rpcUsers = [[ "user": "corda", "password": "corda_initial_password", "permissions": ["ALL"]]]
    }
}

task(runClientB, dependsOn: 'classes', type: JavaExec) {
    classpath = sourceSets.main.runtimeClasspath
    main = 'net.corda.cordaftp.SenderKt'
    args "localhost:$client_port", "$username", "$password", "build/nodes/CorpB/cordaftp.json"
}

推荐答案

您无法控制节点内部使用的依赖项版本.您只能控制CorDapp使用的依赖项.

You cannot control which versions of dependencies the nodes use internally. You can only control the dependencies used by your CorDapp.

这篇关于CordApp的传递依存关系未更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-21 06:08