From c1fe0e739a1827a852808771d7cdba77bd503d0c Mon Sep 17 00:00:00 2001 From: Jose Coll Date: Tue, 19 Dec 2023 08:46:26 +0000 Subject: [PATCH] Resolve conflicts. --- .ci/dev/compatibility/JenkinsfileJDK11Compile | 58 ---- .ci/dev/pr-code-checks/Jenkinsfile | 39 +-- build.gradle | 318 ++++++------------ docker/src/docker/Dockerfile | 6 +- docker/src/docker/Dockerfile-debug | 6 +- docker/src/docker/DockerfileAL | 6 +- gradle.properties | 12 +- .../node/services/api/ServiceHubInternal.kt | 5 +- 8 files changed, 129 insertions(+), 321 deletions(-) delete mode 100644 .ci/dev/compatibility/JenkinsfileJDK11Compile diff --git a/.ci/dev/compatibility/JenkinsfileJDK11Compile b/.ci/dev/compatibility/JenkinsfileJDK11Compile deleted file mode 100644 index 83d4923df3..0000000000 --- a/.ci/dev/compatibility/JenkinsfileJDK11Compile +++ /dev/null @@ -1,58 +0,0 @@ -#!groovy -/** - * Jenkins pipeline to build Corda Opensource Pull Requests with JDK11. - */ - -@Library('corda-shared-build-pipeline-steps') -import static com.r3.build.BuildControl.killAllExistingBuildsForJob - -killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger()) - -pipeline { - agent { - dockerfile { - label 'standard' - additionalBuildArgs '--build-arg USER="${USER}"' // DON'T change quotation - USER variable is substituted by SHELL!!!! - filename '.ci/dev/compatibility/DockerfileJDK11' - } - } - options { - timestamps() - timeout(time: 3, unit: 'HOURS') - buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14')) - } - - environment { - ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials') - BUILD_CACHE_CREDENTIALS = credentials('gradle-ent-cache-credentials') - BUILD_CACHE_PASSWORD = "${env.BUILD_CACHE_CREDENTIALS_PSW}" - BUILD_CACHE_USERNAME = "${env.BUILD_CACHE_CREDENTIALS_USR}" - CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}" - CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}" - CORDA_GRADLE_SCAN_KEY = credentials('gradle-build-scans-key') - CORDA_USE_CACHE = "corda-remotes" - } - - stages { - stage('JDK 11 Compile') { - steps { - authenticateGradleWrapper() - sh "./gradlew --no-daemon --parallel --build-cache -Pcompilation.allWarningsAsErrors=true -Ptests.failFast=false " + - "-Ptests.ignoreFailures=true clean compileAll --stacktrace" - } - } - stage('Deploy nodes') { - steps { - sh "./gradlew --no-daemon --build-cache deployNodes" - } - } - } - post { - always { - findBuildScans() - } - cleanup { - deleteDir() /* clean up our workspace */ - } - } -} diff --git a/.ci/dev/pr-code-checks/Jenkinsfile b/.ci/dev/pr-code-checks/Jenkinsfile index f2996ce6df..5e7085cc1f 100644 --- a/.ci/dev/pr-code-checks/Jenkinsfile +++ b/.ci/dev/pr-code-checks/Jenkinsfile @@ -15,48 +15,35 @@ pipeline { * List environment variables in alphabetical order */ environment { + SNYK_API_TOKEN = credentials('c4-os-snyk-api-token-secret') + C4_OS_SNYK_ORG_ID = credentials('c4-os-snyk-org-id') ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials') - BUILD_CACHE_CREDENTIALS = credentials('gradle-ent-cache-credentials') - BUILD_CACHE_PASSWORD = "${env.BUILD_CACHE_CREDENTIALS_PSW}" - BUILD_CACHE_USERNAME = "${env.BUILD_CACHE_CREDENTIALS_USR}" CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}" CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}" - CORDA_GRADLE_SCAN_KEY = credentials('gradle-build-scans-key') CORDA_USE_CACHE = "corda-remotes" - C4_OS_SNYK_ORG_ID = credentials('c4-os-snyk-org-id') - SNYK_API_TOKEN = credentials('c4-os-snyk-api-token-secret') + JAVA_HOME = "/usr/lib/jvm/java-17-amazon-corretto" } stages { stage('Detekt check') { steps { authenticateGradleWrapper() - sh "./gradlew --no-daemon --parallel --build-cache clean detekt" + sh "./gradlew --no-daemon clean detekt" } } stage('Compilation warnings check') { steps { - sh "./gradlew --no-daemon --parallel --build-cache -Pcompilation.warningsAsErrors=true compileAll" + /* + * TODO JDK17: Re-enable warnings as errors + */ + sh "./gradlew --no-daemon -Pcompilation.warningsAsErrors=false compileAll" } } stage('Snyk Delta') { - agent { - docker { - image 'build-zulu-openjdk:8' - reuseNode true - registryUrl 'https://engineering-docker.software.r3.com/' - registryCredentialsId 'artifactory-credentials' - args '-v /tmp:/host_tmp' - } - } - environment { - GRADLE_USER_HOME = "/host_tmp/gradle" - } + agent { label 'standard' } steps { - authenticateGradleWrapper() - sh 'mkdir -p ${GRADLE_USER_HOME}' authenticateGradleWrapper() snykDeltaScan(env.SNYK_API_TOKEN, env.C4_OS_SNYK_ORG_ID) } @@ -64,21 +51,19 @@ pipeline { stage('No API change check') { steps { - sh "./gradlew --no-daemon --parallel --build-cache generateApi" + sh "./gradlew --no-daemon generateApi" sh ".ci/check-api-changes.sh" } } stage('Deploy Nodes') { steps { - sh "./gradlew --no-daemon --build-cache jar deployNodes" + sh "./gradlew --no-daemon jar deployNodes" } } } + post { - always { - findBuildScans() - } cleanup { deleteDir() /* clean up our workspace */ } diff --git a/build.gradle b/build.gradle index c63f8e5370..c615101f0a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,11 @@ import com.r3.testing.DistributeTestsBy import com.r3.testing.PodLogLevel +import net.corda.plugins.apiscanner.GenerateApi +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import static org.gradle.api.JavaVersion.VERSION_11 -import static org.gradle.api.JavaVersion.VERSION_1_8 +import static org.gradle.api.JavaVersion.VERSION_17 +import static org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 +import static org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8 buildscript { // For sharing constants between builds @@ -15,26 +18,18 @@ buildscript { ext.corda_build_edition = System.getenv("CORDA_BUILD_EDITION")?.trim() ?: "Corda Open Source" ext.corda_platform_version = constants.getProperty("platformVersion") + ext.corda_shell_version = constants.getProperty("cordaShellVersion") ext.gradle_plugins_version = constants.getProperty("gradlePluginsVersion") // Dependency versions. Can run 'gradle dependencyUpdates' to find new versions of things. // // TODO: Sort this alphabetically. - ext.kotlin_version = constants.getProperty("kotlinVersion") ext.warnings_as_errors = project.hasProperty("compilation.warningsAsErrors") ? project.property("compilation.warningsAsErrors").toBoolean() : false ext.quasar_group = 'co.paralleluniverse' // Set version of Quasar according to version of Java used: - if (JavaVersion.current().isJava8()) { - ext.quasar_version = constants.getProperty("quasarVersion") - ext.quasar_classifier = constants.getProperty("quasarClassifier") - ext.jdkClassifier = constants.getProperty("jdkClassifier") - } else { - ext.quasar_version = constants.getProperty("quasarVersion11") - ext.quasar_classifier = constants.getProperty("quasarClassifier11") - ext.jdkClassifier = constants.getProperty("jdkClassifier11") - } - ext.cordaScanApiClassifier = jdkClassifier + ext.quasar_version = constants.getProperty("quasarVersion") + ext.quasar_classifier = constants.getProperty("quasarClassifier") ext.quasar_exclusions = [ 'co.paralleluniverse**', 'groovy**', @@ -49,7 +44,7 @@ buildscript { 'org.junit**', 'org.slf4j**', 'worker.org.gradle.**', - 'com.nhaarman.mockito_kotlin**', + 'org.mockito.kotlin**', 'org.assertj**', 'org.hamcrest**', 'org.mockito**', @@ -116,7 +111,6 @@ buildscript { ext.class_graph_version = constants.getProperty('classgraphVersion') ext.jcabi_manifests_version = constants.getProperty("jcabiManifestsVersion") ext.picocli_version = constants.getProperty("picocliVersion") - ext.commons_lang_version = constants.getProperty("commonsLangVersion") ext.commons_io_version = constants.getProperty("commonsIoVersion") ext.controlsfx_version = constants.getProperty("controlsfxVersion") ext.detekt_version = constants.getProperty('detektVersion') @@ -124,20 +118,27 @@ buildscript { ext.commons_configuration2_version = constants.getProperty("commonsConfiguration2Version") ext.commons_text_version = constants.getProperty("commonsTextVersion") ext.snake_yaml_version = constants.getProperty("snakeYamlVersion") + ext.fontawesomefx_commons_version = constants.getProperty("fontawesomefxCommonsVersion") + ext.fontawesomefx_fontawesome_version = constants.getProperty("fontawesomefxFontawesomeVersion") ext.javaassist_version = constants.getProperty("javaassistVersion") + ext.test_add_opens = [ + '--add-opens', 'java.base/java.time=ALL-UNNAMED', + '--add-opens', 'java.base/java.io=ALL-UNNAMED', + '--add-opens', 'java.base/java.util=ALL-UNNAMED', + '--add-opens', 'java.base/java.net=ALL-UNNAMED', + '--add-opens', 'java.base/java.nio=ALL-UNNAMED', + '--add-opens', 'java.base/java.lang.invoke=ALL-UNNAMED', + '--add-opens', 'java.base/java.security.cert=ALL-UNNAMED', + '--add-opens', 'java.base/java.security=ALL-UNNAMED', + '--add-opens', 'java.base/javax.net.ssl=ALL-UNNAMED', + '--add-opens', 'java.base/java.lang=ALL-UNNAMED', + '--add-opens', 'java.base/java.util.concurrent=ALL-UNNAMED', + '--add-opens', 'java.sql/java.sql=ALL-UNNAMED' + ] + ext.test_add_exports = [ + '--add-exports', 'java.base/sun.nio.ch=ALL-UNNAMED' + ] - if (JavaVersion.current().isJava8()) { - ext.fontawesomefx_commons_version = constants.getProperty("fontawesomefxCommonsJava8Version") - ext.fontawesomefx_fontawesome_version = constants.getProperty("fontawesomefxFontawesomeJava8Version") - } else { - ext.fontawesomefx_commons_version = constants.getProperty("fontawesomefxCommonsVersion") - ext.fontawesomefx_fontawesome_version = constants.getProperty("fontawesomefxFontawesomeVersion") - } - - // Update 121 is required for ObjectInputFilter. - // Updates [131, 161] also have zip compression bugs on MacOS (High Sierra). - // when the java version in NodeStartup.hasMinimumJavaVersion() changes, so must this check - ext.java8_minUpdateVersion = constants.getProperty('java8MinUpdateVersion') ext.corda_revision = { try { "git rev-parse HEAD".execute().text.trim() @@ -171,6 +172,7 @@ buildscript { content { includeGroupByRegex 'net\\.corda(\\..*)?' includeGroupByRegex 'com\\.r3(\\..*)?' + includeGroup 'co.paralleluniverse' } } maven { @@ -180,34 +182,27 @@ buildscript { includeGroupByRegex 'com\\.r3(\\..*)?' } } - gradlePluginPortal() mavenCentral() jcenter() } } dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version" - classpath "net.corda.plugins:publish-utils:$gradle_plugins_version" classpath "net.corda.plugins:quasar-utils:$gradle_plugins_version" classpath "net.corda.plugins:cordformation:$gradle_plugins_version" classpath "net.corda.plugins:cordapp:$gradle_plugins_version" classpath "net.corda.plugins:api-scanner:$gradle_plugins_version" classpath "net.corda.plugins:jar-filter:$gradle_plugins_version" - classpath "net.sf.proguard:proguard-gradle:$proguard_version" + classpath "com.guardsquare:proguard-gradle:$proguard_version" classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0' - classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlin_version" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}" + classpath "org.jetbrains.dokka:dokka-base:$dokka_version" classpath "net.i2p.crypto:eddsa:$eddsa_version" // Needed for ServiceIdentityGenerator in the build environment. - classpath "org.owasp:dependency-check-gradle:${dependency_checker_version}" + classpath "org.owasp:dependency-check-gradle:$dependency_checker_version" classpath "org.jfrog.buildinfo:build-info-extractor-gradle:$artifactory_plugin_version" // Capsule gradle plugin forked and maintained locally to support Gradle 5.x // See https://github.com/corda/gradle-capsule-plugin - classpath "us.kirchmeier:gradle-capsule-plugin:1.0.4_r3" + classpath "us.kirchmeier:gradle-capsule-plugin:1.0.5_r3" classpath group: "com.r3.testing", name: "gradle-distributed-testing-plugin", version: '1.3.0' classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8" - classpath "com.gradle:gradle-enterprise-gradle-plugin:$gradleEnterprisePlugin" - classpath "com.gradle:common-custom-user-data-gradle-plugin:$customUserDataGradlePlugin" } configurations.classpath { @@ -217,34 +212,20 @@ buildscript { } plugins { - // Add the shadow plugin to the plugins classpath for the entire project. - id 'com.github.johnrengelman.shadow' version '2.0.4' apply false + id 'org.jetbrains.kotlin.jvm' apply false + id 'org.jetbrains.kotlin.plugin.allopen' apply false + id 'org.jetbrains.kotlin.plugin.jpa' apply false + id 'com.github.johnrengelman.shadow' version '7.1.2' apply false id "org.ajoberstar.grgit" version "4.0.0" + id 'corda.root-publish' + id "org.jetbrains.dokka" version "1.8.20" } apply plugin: 'project-report' apply plugin: 'com.github.ben-manes.versions' -apply plugin: 'net.corda.plugins.publish-utils' -apply plugin: 'com.jfrog.artifactory' apply plugin: 'com.r3.testing.distributed-testing' -apply plugin: "com.gradle.build-scan" -apply plugin: "com.gradle.common-custom-user-data-gradle-plugin" -buildScan { - server = gradleEnterpriseUrl - allowUntrustedServer = false - def apiKey = project.findProperty('CORDA_GRADLE_SCAN_KEY') ?: System.getenv('CORDA_GRADLE_SCAN_KEY') - if (apiKey?.trim()) { - publishAlways() - capture { - taskInputFiles = true - } - uploadInBackground = false - accessKey = apiKey - } -} - -// If the command line project option -PversionFromGit is added to the gradle invocation, we'll resolve +// If the command line project option -PversionFromGit is added to the gradle invocation, we'll resolve // the latest git commit hash and timestamp and create a version postfix from that if (project.hasProperty("versionFromGit")){ ext.versionSuffix = "${grgit.head().dateTime.format("yyyyMMdd_HHmmss")}-${grgit.head().abbreviatedId}" @@ -257,26 +238,17 @@ if (ext.versionSuffix != ""){ ext.corda_release_version = "${ext.baseVersion}".toString() } -// We need the following three lines even though they're inside an allprojects {} block below because otherwise -// IntelliJ gets confused when importing the project and ends up erasing and recreating the .idea directory, along -// with the run configurations. It also doesn't realise that the project is a Java 8 project and misconfigures -// the resulting import. This fixes it. -apply plugin: 'java' - -logger.lifecycle("Java version: {}", JavaVersion.current()) -sourceCompatibility = VERSION_1_8 -targetCompatibility = JavaVersion.current().isJava8() ? VERSION_1_8 : VERSION_11 -logger.lifecycle("Java source compatibility: {}", sourceCompatibility) -logger.lifecycle("Java target compatibility: {}", targetCompatibility) +logger.lifecycle("JDK: {}", System.getProperty("java.home")) logger.lifecycle("Quasar version: {}", quasar_version) logger.lifecycle("Quasar classifier: {}", quasar_classifier.toString()) logger.lifecycle("Building Corda version: {}", corda_release_version) +logger.lifecycle("User home: {}", System.getProperty('user.home')) allprojects { - apply plugin: 'kotlin' + apply plugin: 'org.jetbrains.kotlin.jvm' + apply plugin: 'kotlin-allopen' apply plugin: 'jacoco' apply plugin: 'org.owasp.dependencycheck' - apply plugin: 'kotlin-allopen' apply plugin: 'org.sonarqube' allOpen { @@ -287,19 +259,6 @@ allprojects { ) } - // we do this to allow for Gradle task caching. - // below block tells Gradle to ignore specifically the dymaically generated files in the manifest when checking if a file is up to date - // this has no impact on publishing or production of jar, This only reates to Grades mechamish for verifying the Cache key - normalization { - runtimeClasspath { - ignore("**/*.EC") //signing related - ignore("**/*.SF") //signing related - ignore("**/*.MF") - ignore("**/*.kotlin_module") - ignore("**/Cordapp-Dependencies") - } - } - dependencyCheck { suppressionFile = '.ci/dependency-checker/suppressedLibraries.xml' cveValidForHours = 1 @@ -314,12 +273,23 @@ allprojects { nugetconfEnabled = false } } - sourceCompatibility = VERSION_1_8 - targetCompatibility = JavaVersion.current().isJava8() ? VERSION_1_8 : VERSION_11 + + sourceCompatibility = VERSION_17 + targetCompatibility = VERSION_17 jacoco { // JDK11 official support (https://github.com/jacoco/jacoco/releases/tag/v0.8.3) - toolVersion = "0.8.3" + toolVersion = "0.8.7" + } + + test { + jvmArgs test_add_opens + jvmArgs test_add_exports + } + + java { + withSourcesJar() + withJavadocJar() } tasks.withType(JavaCompile).configureEach { @@ -334,13 +304,13 @@ allprojects { options.encoding = 'UTF-8' } - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { - kotlinOptions { - languageVersion = "1.2" - apiVersion = "1.2" - jvmTarget = VERSION_1_8 + tasks.withType(KotlinCompile).configureEach { + compilerOptions { + languageVersion = KOTLIN_1_8 + apiVersion = KOTLIN_1_8 + jvmTarget = JVM_17 javaParameters = true // Useful for reflection. - freeCompilerArgs = ['-Xjvm-default=compatibility'] + freeCompilerArgs = ['-Xjvm-default=all-compatibility'] allWarningsAsErrors = warnings_as_errors } } @@ -378,7 +348,7 @@ allprojects { // Required to use Gradle build cache (until Gradle 5.0 is released with default value of "append" set to false) // See https://github.com/gradle/gradle/issues/5269 and https://github.com/gradle/gradle/pull/6419 extensions.configure(TypeOf.typeOf(JacocoTaskExtension)) { ex -> - ex.append = false +// ex.append = false } maxParallelForks = (System.env.CORDA_TESTING_FORKS == null) ? 1 : "$System.env.CORDA_TESTING_FORKS".toInteger() @@ -392,13 +362,6 @@ allprojects { } } - if (jdkClassifier) { - jar { - // JDK11 built and published artifacts to include classifier - archiveClassifier = jdkClassifier - } - } - group 'net.corda' version "$corda_release_version" @@ -437,6 +400,16 @@ allprojects { includeGroup 'com.github.bft-smart' includeGroup 'com.github.detro' } + metadataSources { + mavenPom() + artifact() + } + } + maven { + url "${publicArtifactURL}/corda-dependencies-dev" + content { + includeGroup 'co.paralleluniverse' + } } maven { url "${publicArtifactURL}/corda-dev" @@ -467,8 +440,6 @@ allprojects { all { resolutionStrategy { // Force dependencies to use the same version of Kotlin as Corda. - force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" force "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" // Force dependencies to use the same version of Guava as Corda. @@ -525,8 +496,6 @@ allprojects { cfg.resolutionStrategy { dependencySubstitution { // Force dependencies to use the same version of Kotlin as Corda. - substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk8') with module("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version") - substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk7') with module("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") substitute module('org.jetbrains.kotlin:kotlin-stdlib-common') with module("org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version") substitute module('org.jetbrains.kotlin:kotlin-stdlib') with module("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") substitute module('org.jetbrains.kotlin:kotlin-reflect') with module("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") @@ -550,37 +519,29 @@ sonarqube { } } -// Check that we are running on a Java 8 JDK. The source/targetCompatibility values above aren't sufficient to -// guarantee this because those are properties checked by the Java plugin, but we're using Kotlin. -// -// We recommend a specific minor version (unfortunately, not checkable directly) because JavaFX adds APIs in -// minor releases, so we can't work with just any Java 8, it has to be a recent one. -if (!JavaVersion.current().java8Compatible) - throw new GradleException("Corda requires Java 8, please upgrade to at least 1.8.0_$java8_minUpdateVersion") - configurations { detekt } // Required for building out the fat JAR. dependencies { - compile project(':node') - compile "com.google.guava:guava:$guava_version" + implementation project(':node') + implementation "com.google.guava:guava:$guava_version" - // Set to corda compile to ensure it exists now deploy nodes no longer relies on build - compile project(path: ":node:capsule", configuration: 'runtimeArtifacts') - compile project(path: ":testing:testserver:testcapsule:", configuration: 'runtimeArtifacts') + // Set to corda implementation to ensure it exists now deploy nodes no longer relies on build + implementation project(path: ":node:capsule", configuration: 'runtimeArtifacts') + implementation project(path: ":testing:testserver:testcapsule:", configuration: 'runtimeArtifacts') // For the buildCordappDependenciesJar task - runtime project(':client:jfx') - runtime project(':client:mock') - runtime project(':client:rpc') - runtime project(':core') - runtime project(':confidential-identities') - runtime project(':finance:workflows') - runtime project(':finance:contracts') - runtime project(':testing:testserver') - testCompile project(':test-utils') + runtimeOnly project(':client:jfx') + runtimeOnly project(':client:mock') + runtimeOnly project(':client:rpc') + runtimeOnly project(':core') + runtimeOnly project(':confidential-identities') + runtimeOnly project(':finance:workflows') + runtimeOnly project(':finance:contracts') + runtimeOnly project(':testing:testserver') + testImplementation project(':test-utils') detekt 'io.gitlab.arturbosch.detekt:detekt-cli:1.0.1' } @@ -589,12 +550,12 @@ jar { enabled = false } -task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { +tasks.register('jacocoRootReport', JacocoReport) { dependsOn = subprojects.test - additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs) - sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) - classDirectories = files(subprojects.sourceSets.main.output) - executionData = files(subprojects.jacocoTestReport.executionData) +// additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs) +// sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) +// classDirectories = files(subprojects.sourceSets.main.output) +// executionData = files(subprojects.jacocoTestReport.executionData) reports { html.enabled = true xml.enabled = true @@ -618,13 +579,13 @@ tasks.register('detekt', JavaExec) { def plugins = detektPluginsJar.outputs.files.singleFile def params = ['-i', input, '-c', config, '-b', baseline, '--plugins', plugins] inputs.files(detektPluginsJar, config, baseline) - main = "io.gitlab.arturbosch.detekt.cli.Main" + mainClass = "io.gitlab.arturbosch.detekt.cli.Main" classpath = configurations.detekt args(params) } tasks.register('detektBaseline', JavaExec) { - main = "io.gitlab.arturbosch.detekt.cli.Main" + mainClass = "io.gitlab.arturbosch.detekt.cli.Main" classpath = configurations.detekt def input = "$projectDir" def config = "$projectDir/detekt-config.yml, $projectDir/detekt-baseline-config.yml" @@ -637,100 +598,25 @@ tasks.withType(Test).configureEach { reports.html.destination = file("${reporting.baseDir}/${name}") } -task testReport(type: TestReport) { +tasks.register('testReport', TestReport) { destinationDir = file("$buildDir/reports/allTests") // Include the results from the `test` task in all subprojects reportOn subprojects*.test } -bintrayConfig { - user = System.getenv('CORDA_BINTRAY_USER') - key = System.getenv('CORDA_BINTRAY_KEY') - repo = 'corda' - org = 'r3' - licenses = ['Apache-2.0'] - vcsUrl = 'https://github.com/corda/corda' - projectUrl = 'https://github.com/corda/corda' - gpgSign = true - gpgPassphrase = System.getenv('CORDA_BINTRAY_GPG_PASSPHRASE') - publications = [ - 'corda-opentelemetry', - 'corda-opentelemetry-driver', - 'corda-jfx', - 'corda-mock', - 'corda-rpc', - 'corda-core', - 'corda', - 'corda-finance-workflows', - 'corda-finance-contracts', - 'corda-node', - 'corda-node-api', - 'corda-test-common', - 'corda-core-test-utils', - 'corda-test-utils', - 'corda-test-db', - 'corda-jackson', - 'corda-testserver-impl', - 'corda-testserver', - 'corda-node-driver', - 'corda-confidential-identities', - 'corda-shell', - 'corda-tools-shell-cli', - 'corda-serialization', - 'corda-tools-blob-inspector', - 'corda-tools-explorer', - 'corda-tools-network-bootstrapper', - 'corda-tools-cliutils', - 'corda-common-configuration-parsing', - 'corda-common-validation', - 'corda-common-logging', - 'corda-tools-network-builder', - 'corda-tools-checkpoint-agent' - ] - license { - name = 'Apache-2.0' - url = 'https://www.apache.org/licenses/LICENSE-2.0' - distribution = 'repo' - } - developer { - id = 'R3' - name = 'R3' - email = 'dev@corda.net' - } -} - -// Build a ZIP of all JARs required to compile the Cordapp template // Note: corda.jar is used at runtime so no runtime ZIP is necessary. // Resulting ZIP can be found in "build/distributions" -task buildCordappDependenciesZip(type: Zip) { +tasks.register('buildCordappDependenciesZip', Zip) { baseName 'corda-deps' - from configurations.runtime - from configurations.compile - from configurations.testCompile + from configurations.runtimeOnly + from configurations.implementation + from configurations.testImplementation from buildscript.configurations.classpath from 'node/capsule/NOTICE' // CDDL notice duplicatesStrategy = DuplicatesStrategy.EXCLUDE } -artifactory { - publish { - contextUrl = artifactory_contextUrl - repository { - repoKey = 'corda-dev' - username = System.getenv('CORDA_ARTIFACTORY_USERNAME') - password = System.getenv('CORDA_ARTIFACTORY_PASSWORD') - } - - defaults { - // Root project applies the plugin (for this block) but does not need to be published - if (project != rootProject) { - publications(project.extensions.publish.name()) - } - } - } -} - -tasks.register('generateApi', net.corda.plugins.apiscanner.GenerateApi) { +tasks.register('generateApi', GenerateApi) { baseName = "api-corda" } diff --git a/docker/src/docker/Dockerfile b/docker/src/docker/Dockerfile index a6014f8973..ecd3bb48d5 100644 --- a/docker/src/docker/Dockerfile +++ b/docker/src/docker/Dockerfile @@ -1,11 +1,11 @@ -FROM azul/zulu-openjdk:8u392 +FROM azul/zulu-openjdk:17.0.8.1 ## Remove Azul Zulu repo, as it is gone by now RUN rm -rf /etc/apt/sources.list.d/zulu.list ## Add packages, clean cache, create dirs, create corda user and change ownership RUN apt-get update && \ - apt-mark hold zulu8-jdk && \ + apt-mark hold zulu17-jdk && \ apt-get -y upgrade && \ apt-get -y install bash curl unzip && \ rm -rf /var/lib/apt/lists/* && \ @@ -33,7 +33,7 @@ ENV CORDAPPS_FOLDER="/opt/corda/cordapps" \ MY_RPC_PORT=10201 \ MY_RPC_ADMIN_PORT=10202 \ PATH=$PATH:/opt/corda/bin \ - JVM_ARGS="-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap " \ + JVM_ARGS="-XX:+UnlockExperimentalVMOptions " \ CORDA_ARGS="" ##CORDAPPS FOLDER diff --git a/docker/src/docker/Dockerfile-debug b/docker/src/docker/Dockerfile-debug index b7dd204884..8b36530f5e 100644 --- a/docker/src/docker/Dockerfile-debug +++ b/docker/src/docker/Dockerfile-debug @@ -1,8 +1,8 @@ -FROM azul/zulu-openjdk:8u392 +FROM azul/zulu-openjdk:17.0.8.1 ## Add packages, clean cache, create dirs, create corda user and change ownership RUN apt-get update && \ - apt-mark hold zulu8-jdk && \ + apt-mark hold zulu17-jdk && \ apt-get -y upgrade && \ apt-get -y install bash curl unzip netstat lsof telnet netcat && \ rm -rf /var/lib/apt/lists/* && \ @@ -28,7 +28,7 @@ ENV CORDAPPS_FOLDER="/opt/corda/cordapps" \ MY_RPC_PORT=10201 \ MY_RPC_ADMIN_PORT=10202 \ PATH=$PATH:/opt/corda/bin \ - JVM_ARGS="-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap " \ + JVM_ARGS="-XX:+UnlockExperimentalVMOptions " \ CORDA_ARGS="" ##CORDAPPS FOLDER diff --git a/docker/src/docker/DockerfileAL b/docker/src/docker/DockerfileAL index 816ef57027..73a21334d7 100644 --- a/docker/src/docker/DockerfileAL +++ b/docker/src/docker/DockerfileAL @@ -1,4 +1,4 @@ -FROM amazoncorretto:8u392-al2 +FROM amazoncorretto:17.0.9 ## Add packages, clean cache, create dirs, create corda user and change ownership RUN yum -y install bash && \ @@ -31,7 +31,7 @@ ENV CORDAPPS_FOLDER="/opt/corda/cordapps" \ MY_RPC_PORT=10201 \ MY_RPC_ADMIN_PORT=10202 \ PATH=$PATH:/opt/corda/bin \ - JVM_ARGS="-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap " \ + JVM_ARGS="-XX:+UnlockExperimentalVMOptions " \ CORDA_ARGS="" ##CORDAPPS FOLDER @@ -65,4 +65,4 @@ COPY --chown=corda:corda starting-node.conf /opt/corda/starting-node.conf USER "corda" EXPOSE ${MY_P2P_PORT} ${MY_RPC_PORT} ${MY_RPC_ADMIN_PORT} WORKDIR /opt/corda -CMD ["run-corda"] \ No newline at end of file +CMD ["run-corda"] diff --git a/gradle.properties b/gradle.properties index a54780ad19..1e6c30d918 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,10 @@ kotlin.incremental=true -org.gradle.jvmargs=-XX:+UseG1GC -Xmx4g -Dfile.encoding=UTF-8 -org.gradle.caching=true +org.gradle.jvmargs=-Xmx6g -Dfile.encoding=UTF-8 --add-opens 'java.base/java.time=ALL-UNNAMED' --add-opens 'java.base/java.io=ALL-UNNAMED' +org.gradle.caching=false owasp.failOnError=false owasp.failBuildOnCVSS=11.0 compilation.allWarningsAsErrors=false test.parallel=false - -# Gradle Enterprise -gradleEnterpriseUrl = https://gradle.dev.r3.com -gradleEnterprisePlugin = 3.8.1 -customUserDataGradlePlugin = 1.6.3 +kotlin_version=1.9.0 +commons_lang3_version=3.12.0 +json_api_version=1.1.4 diff --git a/node/src/main/kotlin/net/corda/node/services/api/ServiceHubInternal.kt b/node/src/main/kotlin/net/corda/node/services/api/ServiceHubInternal.kt index b283c137c4..a0e8fe83c7 100644 --- a/node/src/main/kotlin/net/corda/node/services/api/ServiceHubInternal.kt +++ b/node/src/main/kotlin/net/corda/node/services/api/ServiceHubInternal.kt @@ -38,12 +38,9 @@ import net.corda.node.services.persistence.AttachmentStorageInternal import net.corda.node.services.statemachine.ExternalEvent import net.corda.node.services.statemachine.FlowStateMachineImpl import net.corda.nodeapi.internal.persistence.CordaPersistence +import java.security.PublicKey import java.security.SignatureException -import java.util.ArrayList import java.util.Collections -import java.util.HashMap -import java.util.HashSet -import java.util.LinkedHashSet interface NetworkMapCacheInternal : NetworkMapCache, NetworkMapCacheBase { override val nodeReady: OpenFuture