I've tried using this with the following constants:
cordaReleaseGroup=net.corda
cordaCoreReleaseGroup=net.corda
cordaVersion=4.5.1
cordaCoreVersion=4.5.1
gradlePluginsVersion=5.0.9
kotlinVersion=1.2.71
junitVersion=4.12
quasarVersion=0.7.10
log4jVersion=2.11.2
platformVersion=5
slf4jVersion=1.7.25
... with the following deployNodes
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
nodeDefaults {
projectCordapp {
deploy = false
}
cordapp project(':contracts')
cordapp project(':workflows')
quasarExcludePackages = ["io.cordite.braid.libs**"]
}
Gradle throws an error for unknown property for quasarExcludePackages.
You need to add it via extra config like so:
nodeDefaults {
projectCordapp {
deploy = false
}
cordapp project(':contracts')
cordapp project(':workflows')
extraConfig = ["quasarExcludePackages": ["io.cordite.braid.libs**"]]
}
Related
im using liferay 7.1 ,and when i want to deploy a SpringMvcPortlet i got this error :
Could not resolve all files for configuration ':wars:mySpringMvcPortlet:compileClasspath'.
Could not find javax.validation:validation-api:.
Required by:
project :wars:SpringMvcPortletFormation
Could not find org.hibernate.validator:hibernate-validator:.
Required by:
project :wars:SpringMvcPortletFormationPossible solution:
Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Do you have an idea where my error is?
Thanks in advance
You have a dependency issue here, you have to manage all your dependency for the SpringMvcPortletFormationPossible project, and you need to put them properly in the build.gradle file,
So I recommand to add mavenLocal() to the repositories { } to be able to search all the local dependencies from the local repo and find them properly:
Example:
buildscript {
dependencies {
classpath group: "com.liferay", name: "com.liferay.gradle.plugins", version: "3.13.8"
}
repositories {
mavenLocal()
maven {
url "https://repository-cdn.liferay.com/nexus/content/groups/public"
}
}
}
apply plugin: "com.liferay.plugin"
dependencies { .... // your dependency here // .... }
repositories {
mavenLocal()
maven {
url "https://repository-cdn.liferay.com/nexus/content/groups/public"
}
}
I have recently moved an enterprise CorDapp to a different machine running Ubuntu. I have install all the correct dependencies as described in the docs. When I initially run ./gradlew clean deployNodes, everything builds fine. However, when I do subsequent builds, I keep getting the error:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':cordapp-source:deployNodes'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.IllegalStateException: Error while generating node info file. Please check the logs in /home/ubuntu/cordapp/cordapp-source/build/nodes/Node1/logs.
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.generateNodeInfo(NetworkBootstrapper.kt:112)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.access$generateNodeInfo(NetworkBootstrapper.kt:71)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:95)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:71)
at net.corda.core.internal.concurrent.ValueOrException$DefaultImpls.capture(CordaFutureImpl.kt:140)
at net.corda.core.internal.concurrent.OpenFuture$DefaultImpls.capture(CordaFutureImpl.kt)
at net.corda.core.internal.concurrent.CordaFutureImpl.capture(CordaFutureImpl.kt:152)
at net.corda.core.internal.concurrent.CordaFutureImplKt$fork$$inlined$also$lambda$1.run(CordaFutureImpl.kt:32)
Suppressed: java.lang.IllegalStateException: Error while generating node info file. Please check the logs in /home/ubuntu/cordapp/cordapp-source/build/nodes/Node2/logs.
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.generateNodeInfo(NetworkBootstrapper.kt:112)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.access$generateNodeInfo(NetworkBootstrapper.kt:71)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:95)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:71)
at net.corda.core.internal.concurrent.ValueOrException$DefaultImpls.capture(CordaFutureImpl.kt:140)
at net.corda.core.internal.concurrent.OpenFuture$DefaultImpls.capture(CordaFutureImpl.kt)
at net.corda.core.internal.concurrent.CordaFutureImpl.capture(CordaFutureImpl.kt:152)
at net.corda.core.internal.concurrent.CordaFutureImplKt$fork$$inlined$also$lambda$1.run(CordaFutureImpl.kt:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Furthermore, the log files for the nodes are mostly empty and don't give any clue as to what is going on. Initially I thought it may be to do with heap size as this new machine has 8 cores but I don't get any 'out of memory' errors. Any suggestions as to where to look would be greatly appreciated!
Below are the build.gradle files I am using:
In build.gradle:
buildscript {
ext.corda_release_distribution = 'com.r3.corda'
ext.corda_release_version = '3.1'
ext.corda_gradle_plugins_version = '4.0.25'
ext.kotlin_version = '1.2.50'
ext.junit_version = '4.12'
ext.okhttp_version = '3.5.0'
ext.commons_validator_version = '1.4.1'
ext.joda_version = '2.9.9'
ext.aws_java_sdk_version = '1.11.228'
ext.apache_tika_version = '1.11'
ext.postgresql_version = '42.2.2'
ext.rabbitmq_amqp_version = '3.3.4'
ext.spring_boot_version = '2.0.2.RELEASE'
ext.spring_boot_gradle_plugin_version = '2.0.2.RELEASE'
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 "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_gradle_plugin_version"
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://dl.bintray.com/kotlin/exposed' }
maven { url 'https://jitpack.io' }
}
}
In src/build.grade:
apply plugin: 'kotlin'
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'
jar.baseName = "test-ledger"
sourceSets {
main {
resources {
srcDir "../config/dev"
}
}
test {
resources {
srcDir "../config/test"
}
}
integrationTest {
kotlin {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/kotlin')
}
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
dependencies {
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testCompile "junit:junit:$junit_version"
// Corda integration dependencies
cordaCompile "$corda_release_distribution:corda-core:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-finance:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-jackson:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-rpc:$corda_release_version"
cordaRuntime "$corda_release_distribution:corda:$corda_release_version"
testCompile "$corda_release_distribution:corda-node-driver:$corda_release_version"
// CorDapp dependencies
cordapp "$corda_release_distribution:corda-finance:$corda_release_version"
compile "org.postgresql:postgresql:$postgresql_version"
compile "commons-validator:commons-validator:$commons_validator_version"
compile "com.squareup.okhttp3:okhttp:$okhttp_version"
compile "joda-time:joda-time:$joda_version"
compile "com.amazonaws:aws-java-sdk-s3:$aws_java_sdk_version"
compile "org.apache.tika:tika-core:$apache_tika_version"
compile "com.rabbitmq:amqp-client:$rabbitmq_amqp_version"
}
task integrationTest(type: Test, dependsOn: []) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
languageVersion = "1.1"
apiVersion = "1.1"
jvmTarget = "1.8"
javaParameters = true // Useful for reflection.
}
}
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
directory "./build/nodes"
node {
name "O=Notary,L=Sydney,C=AU"
notary = [validating : false]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
cordapps = ["$corda_release_distribution:corda-finance:$corda_release_version"]
}
node {
name "O=Node1,L=Sydney,C=AU"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
cordapps = ["$corda_release_distribution:corda-finance:$corda_release_version"]
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=Node2,L=Sydney,C=AU"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
cordapps = ["$corda_release_distribution:corda-finance:$corda_release_version"]
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}
Below is the only change that I make to the build.gradle file to shift from Enterprise to Open Source which runs as expected (I can keep running ./gradlew clean deployNodes).
ext.corda_release_distribution = 'net.corda'
ext.corda_release_version = '3.2-corda'
ext.corda_gradle_plugins_version = '3.1.0'
ext.kotlin_version = '1.1.60'
ext.junit_version = '4.12'
ext.quasar_version = '0.7.9'
Try removing the the "clean" task from ./gradlew clean build
What version of Gradle are you using? We have noticed that unless you are using 4.8 or 4.9 the build fails. You may try to see what your Gradle wrapper is specifying.
The problem:
I have a jar in some repository.
I want to run the jar and do something with it during gradle task.
The attempt:
apply plugin: 'java'
repositories {
maven {
url "<<<valid repo url>>>"
}
mavenCentral()
}
dependencies {
compile(group: 'com.google.developers', name: 'compiler', version: 'v20150315', ext: 'pom')
}
task doTheJar {
dependsOn configurations.compile
exec {
executable "sh"
args "-c","java -jar <<the-artifact>> smoething something"
}
}
Is there a way to do it?
Is there a way to do it without java plugin?
Thanks.
It will be better to do it in the following way:
apply plugin: 'java'
repositories {
maven {
url "<<<valid repo url>>>"
}
mavenCentral()
}
configurations {
runjar
}
dependencies {
runjar 'some:artifact:1.0'
}
task runTheJar(type: JavaExec) {
main 'main.class.to.be.run'
classpath configurations.runjar
args 's1', 's2', 's3'
}
I have two task nativeJar and native64Jar, manifest and doLast closers are same for both the tasks except the file names. So is It possible to extract that code in a common method and pass two file names as a method parameter and call that common method from both tasks or call that method from dolast clouser.
task nativeJar( type: Jar ) {
doFirst {
delete fileTree(dir: "$releaseDir", include: "*.jar")
}
baseName = 'NativeLibs'
destinationDir = new File(releaseDir)
from files(releaseDir + 'jar_merge/signedNativeLibs')
manifest {
attributes 'Permissions' : 'all-permissions', 'Publisher' : 'abc', 'Application-Name' : 'WorkBench', 'Codebase' : '*.abc.com'
}
doLast {
ant.signjar( jar: "$releaseDir/NativeLibs.jar", alias:"WorkBench", keystore: "WorkBench.jks", signedjar: "$releaseDir/signedNativeLibs.jar", storepass: "freddie" )
}
}
// Create signedNativeLibs64.jar file
task native64Jar( type: Jar , dependsOn: 'nativeJar' ) {
baseName = 'NativeLibs64'
destinationDir = new File(releaseDir)
from files(releaseDir + 'jar_merge/signedNativeLibs64')
manifest {
attributes 'Permissions' : 'all-permissions', 'Publisher' : 'abc', 'Application-Name' : 'WorkBench', 'Codebase' : '*.abc.com'
}
doLast {
ant.signjar( jar: "$releaseDir/NativeLibs64.jar", alias:"WorkBench", keystore: "WorkBench.jks", signedjar: "$releaseDir/signedNativeLibs64.jar", storepass: "freddie" )
}
}
I would recommend splitting out the signing as a separate task so that you get proper up-to-date checks from Gradle. As you have it now, you'll always sign the jar every time you build. And if you delete the signed jar, it won't generate again until you clean the native jar too.
You can share configuration closures between tasks. E.g.,
[ task1, task2 ].each { task ->
task.configure {
// shared closure
}
}
There are a few other best practices I'd follow.
Don't use new File() since it makes your script dependent on the current working directory.
Refer to outputs via the task versus recreating the full path (e.g., what you're doing with $releaseDir/NativeLibs.jar). Gradle is able to infer dependencies that way.
Use a custom task class vs an ad-hoc task with doFirst()/doLast(). Since you're delegating all the work to the ant task, this should be really simple.
I'm not sure why you need your particular file names, but I left them as-is. If they're not important, removing them would make this even simpler.
I took a stab at your example (disclaimer: I didn't try it):
task nativeJar( type: Jar ) {
baseName = 'NativeLibs'
from files(releaseDir + 'jar_merge/signedNativeLibs')
}
task native64Jar( type: Jar ) {
baseName = 'NativeLibs64'
from files(releaseDir + 'jar_merge/signedNativeLibs64')
}
[ nativeJar, native64Jar ].each { task ->
task.configure {
destinationDir = file(releaseDir)
manifest {
attributes 'Permissions' : 'all-permissions', 'Publisher' : 'Financial Engineering', 'Application-Name' : 'WorkBench', 'Codebase' : '*.fhlmc.com'
}
}
}
// this class definition should go at the top of your build.gradle script else it will through an exception mentioned in comments
class SignJarTask extends DefaultTask {
#InputFile File inputFile
#OutputFile File outputFile
#TaskAction
void signJar() {
ant.signjar( jar: inputFile, alias:"WorkBench", keystore: "WorkBench.jks", signedjar: outputFile, storepass: "freddie" )
}
}
task signJar(type: SignJarTask) {
inputFile = file("$releaseDir/NativeLibs.jar")
outputFile = file("$releaseDir/signedNativeLibs.jar")
}
task sign64Jar(type: SignJarTask) {
inputFile = file("$releaseDir/NativeLibs64.jar")
outputFile = file("$releaseDir/signedNativeLibs64.jar")
}
I have cloned the corda-training-template repo and had wanted to test signature constraints in Corda v4.x. Rather than getting a test key to sign the jar, I would go for the default corda dev key for convenience. However my understanding is that corda dev key is used as default if you don't put in any custom credentials, so that all jars are signed with it. However it keep printing out the error message during build as:
* What went wrong:
Execution failed for task ':kotlin-source:jar'. > Exception while signing kotlin-source-0.1.jar, ensure the 'cordapp.signing.options' entry contains correct keyStore configuration, or disable signing by 'cordapp.signing.enabled false'. Run with --info or --debug option and search for 'ant:signjar' in log output.
The following is the original build.gradle for the kotlin-source with signing enable false removed:
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' }
}
apply plugin: 'kotlin'
apply plugin: 'idea'
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.publish-utils'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'
apply plugin: 'maven-publish'
cordapp {
targetPlatformVersion 4
minimumPlatformVersion 3
contract {
name "Corda Training Material"
vendor "R3"
licence "Contact R3 for Kotlin Source Contract License."
versionId 1
}
workflow {
name "Corda Training Material"
vendor "R3"
licence "Contact R3 for Kotlin Source Workflow License."
versionId 1
}
}
sourceSets {
main {
resources {
srcDir "../config/dev"
}
}
test {
resources {
srcDir "../config/test"
}
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testCompile "junit:junit:$junit_version"
// Corda integration dependencies
cordaCompile "$corda_release_distribution:corda-core:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-finance-contracts:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-finance-workflows:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-jackson:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-rpc:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-node-api:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-webserver-impl:$corda_release_version"
cordaRuntime "$corda_release_distribution:corda:$corda_release_version"
cordaRuntime "$corda_release_distribution:corda-webserver:$corda_release_version"
testCompile "$corda_release_distribution:corda-test-utils:$corda_release_version"
testCompile "$corda_release_distribution: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
cordapp "$corda_release_distribution:corda-finance-contracts:$corda_release_version"
cordapp "$corda_release_distribution:corda-finance-workflows:$corda_release_version"
cordapp "$corda_release_distribution:corda-confidential-identities:$corda_release_version"
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
languageVersion = "1.2"
apiVersion = "1.2"
jvmTarget = "1.8"
javaParameters = true // Useful for reflection.
}
}
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
delete "./build/nodes"
directory "./build/nodes"
nodeDefaults {
cordapp("$corda_release_distribution:corda-finance-contracts:$corda_release_version")
cordapp("$corda_release_distribution:corda-finance-workflows:$corda_release_version")
cordapp("$corda_release_distribution:corda-confidential-identities:$corda_release_version")
rpcUsers = [[ user: "user1", "password": "password", "permissions": ["ALL"]]]
}
node {
name "O=Notary,L=London,C=GB"
notary = [validating: false]
p2pPort 10002
rpcSettings {
useSsl false
standAloneBroker false
address "0.0.0.0:10003"
adminAddress "0.0.0.0:10103"
}
}
node {
name "O=ParticipantA,L=London,C=GB"
p2pPort 10007
webPort 10009
rpcSettings {
useSsl false
standAloneBroker false
address "0.0.0.0:10008"
adminAddress "0.0.0.0:10108"
}
}
node {
name "O=ParticipantB,L=New York,C=US"
p2pPort 10010
webPort 10012
rpcSettings {
useSsl false
standAloneBroker false
address "0.0.0.0:10011"
adminAddress "0.0.0.0:10111"
}
}
node {
name "O=ParticipantC,L=Paris,C=FR"
p2pPort 10013
webPort 10015
rpcSettings {
useSsl false
standAloneBroker false
address "0.0.0.0:10014"
adminAddress "0.0.0.0:10114"
}
}
}
idea {
module {
downloadJavadoc = true // defaults to false
downloadSources = true
}
}
In response to the error message, i have added the following to the build.gradle under both cordapp (https://docs.corda.net/releases/release-V4.0/cordapp-build-systems.html#signing-the-cordapp-jar) and deployNodes (https://docs.corda.net/releases/release-V4.0/generating-a-node.html#signing-cordapp-jars) task in different permutations but the same error message asking for right keystore configuration keeps showing up:
signing {
enabled true
options {
keystore
alias
storepass
storetype
keyalg
}
}
Without the mentioning about the credentials of the keystore or even specifying signing options, corda should build the jar with the default corda dev keys, but it isn't the case.
For a start the error message is misleading and doesn't say exactly what is happening within the java jarsigner tool (see ant signjar). Instead there is a likelihood that there is a problem with the jar such that jarsigner is unable to sign. SignJar.kt (Line 23 to 24) from the corda core plugin throws a generic error message when it encounters an error, so one would need to run the jar tasks with either --info or --debug mode, followed by scanning the messages for [ant:signjar].
In my encounter following running the jar signing task with --debug mode, showed an error message of the following:
01:00:15.040 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:signjar] jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: META-INF/LICENSE.txt
Likely the problem is while trying to fatjar (with other libs), the license files from other jars are causing a conflict. The resolution in my case is to exclude the license file from my build. Add the following to the build.gradle jar task.
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
After i have build the jar, I used the jarsigner tool (include in your JDK) to verify if the jar has been signed.
jarsigner -verify <your jar.file name>
If its signed, it will output the following:
jar verified.
Warning:
This jar contains entries whose certificate chain is not validated.
This jar contains entries whose signer certificate will expire within six months.
This jar contains signatures that does not include a timestamp. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2019-11-26) or after any future revocation date.
Re-run with the -verbose and -certs options for more details.