无法从本地的 jar 文件中找到 cordapp



我的corda spring网络服务器项目无法引用corda示例cordapp。基于这个 https://github.com/corda/samples/tree/release-V4/spring-webserver,我将网络服务器和示例作为两个不同的项目。

我从示例项目中创建了 jar,并将其 jar 放在 webserver 项目下的 lib 文件夹中。但是当我运行 gradlew runPartyAs 时它失败

> Could not resolve all files for configuration ':compileClasspath'.
> Could not find :cordaAPI:.
Required by:
project :
  • 尝试: 使用 --info 或 --debug 选项运行以获取更多日志输出。使用 --scan 运行以获取完整的见解。

  • 例外情况是: org.gradle.api.tasks.TaskExecutionException: 任务 ':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'
}

runPartyAServer执行代码,它不会直接从jar运行。如果要使用runPartyAServer相关代码需要在项目中。

我认为cordapp name: cordaAPI也不是有效的语法。

看看:https://github.com/corda/cordapp-template-kotlin 一个集成了弹簧网络服务器+corda的示例。

最新更新