0
votes

My corda spring webserver project fails to refer to corda example cordapp. Based on this https://github.com/corda/samples/tree/release-V4/spring-webserver, I have webserver and example as two different projects.

I created jar out of example project, and placed its jar in lib folder under webserver project. But it fails when I run gradlew runPartyAServer

> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find :cordaAPI:.
     Required by:
         project :
  • Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileKotlin'.

    repositories {
        mavenLocal()
        mavenCentral()
        jcenter()
        maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
        flatDir {
            dirs "$rootProject.projectDir/libs"
        }
        flatDir {
            dirs 'libs'
        }
    }

    dependencies {
    webserver\\libs\\cordaAPI-0.1.jar"))
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
    testCompile "junit:junit:$junit_version"
    testCompile name: 'cordaAPI'
    // Corda dependencies.
    compile "$corda_release_group:corda-core:$corda_release_version"
    compile "$corda_release_group:corda-rpc:$corda_release_version"
    compile("org.springframework.boot:spring-boot-starter- 
    websocket:$spring_boot_version") {
        exclude group: "org.springframework.boot", module: "spring-boot- 
    starter-logging"
    }
    compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version"
    compile "org.apache.logging.log4j:log4j-web:2.7"
    runtime "$corda_release_group:corda:$corda_release_version"
    cordapp name: 'cordaAPI'
}
1

1 Answers

0
votes

runPartyAServer executes code, it does not run directly from a jar. If you want to use runPartyAServer the relevant code needs to be in the project.

I dont think cordapp name: cordaAPI is valid syntax either.

Take a look at: https://github.com/corda/cordapp-template-kotlin for an example that integrates a spring webserver + corda.