corda-gradle-plugins icon indicating copy to clipboard operation
corda-gradle-plugins copied to clipboard

Facing issue with v5.1.1

Open sandeepnRES opened this issue 1 year ago • 3 comments

Hi, I'm using Corda version 4.8.11, and due to log4j vulnerability had to move to gradle version 7.0+, and the only corda gradle plugin version 5.1.1 supports gradle version 7.0+. But when I'm trying to use it in the same way this repo uses: https://github.com/corda/cordapp-template-kotlin/blob/release-V4/build.gradle I'm getting following error:

> Task :jar
Cordapp metadata not defined for this gradle build file. See https://docs.corda.net/head/cordapp-build-systems.html#separation-of-cordapp-contracts-flows-and-services

> Task :deployNodes FAILED
Running Cordform task
Deleting build/nodes

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':deployNodes'.
> No JAR matching '^corda-(?!(testserver-|webserver-)).*\.jar$' found. Have you deployed the Corda project to Maven?

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s
8 actionable tasks: 5 executed, 3 up-to-date

Although this repo is using old gradle 5.6 and corda gradle plugin is 5.0.12. I could not find any example for corda gradle plugin v5.1.1. There is no proper documentation anywhere on this too. So any kind of help on this would be really great.

Thanks.

sandeepnRES avatar Feb 27 '24 12:02 sandeepnRES

See https://docs.r3.com/en/platform/corda/4.9/community/release-notes.html#corda-community-edition-492-release-notes You need to be using at least Corda 4.9.2.

adelel1 avatar Feb 27 '24 13:02 adelel1

@adelel1 Thanks for quick response. I tried 4.9.2 and even latest 4.11, I still get the same error as above. This is how my constants.properties looks like:

cordaReleaseGroup=net.corda
cordaCoreReleaseGroup=net.corda
cordaVersion=4.9.2
cordaCoreVersion=4.9.2
gradlePluginsVersion=5.1.1
kotlinVersion=1.3.72
junitVersion=4.12
log4jVersion =2.17.2
platformVersion=10
slf4jVersion=1.7.36
nettyVersion=4.1.22.Final
arrowVersion=0.10.4
springBootVersion=2.0.2.RELEASE

build.gradle is almost same as above shared link to corda-samples, except that I'm using task dockerform.

sandeepnRES avatar Mar 19 '24 10:03 sandeepnRES

I was able to solve the issue by using build.gradle from a test file here (which is very deep buried): https://github.com/corda/corda-gradle-plugins/blob/release/5.1.1/cordformation/src/test/resources/net/corda/plugins/DeployTwoNodeCordappWithDocker.gradle

My issue was not using corda but using cordaProvided as in earlier versions it was cordaCompile for net.corda:corda dependency.

Would recommend to add link to these files in readme as samples for users to refer to.

sandeepnRES avatar Mar 19 '24 11:03 sandeepnRES