Error: No corda JAR found. Have you deployed the Corda project to Maven? Looked for "corda-4.9.jar"

I’m trying to create a root build.gradle file from scratch since all available examples use deprecated features of gradle. The error in the title arises when I try to run the deployNodes task. Here’s the gradle.build file:

buildscript {
    ext {
        // this is required, otherwise `deployNodes` task throws an error
        corda_release_version = 4.9
    }

    repositories {
        mavenCentral()
        maven { url 'https://software.r3.com/artifactory/corda' }
        maven { url 'https://software.r3.com/artifactory/corda-lib' }
        maven { url 'https://software.r3.com/artifactory/corda-releases' }
        maven { url 'https://jitpack.io' }
        maven { url "https://repo.gradle.org/gradle/libs-releases-local/" }
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32"
        classpath "net.corda.plugins:cordapp:5.0.15"
        classpath "net.corda.plugins:cordformation:5.0.15"
        classpath "net.corda.plugins:quasar-utils:5.0.15"
    }
}

plugins {
    // Apply the Kotlin JVM plugin to add support for Kotlin.
    id 'org.jetbrains.kotlin.jvm' version '1.4.32'
    id 'net.corda.plugins.cordapp' version '5.0.15'
    id "net.corda.plugins.cordformation" version "5.0.15"
    id "net.corda.plugins.quasar-utils" version "5.0.15"
}

// this is applied both for root project and for the subprojects
allprojects {
    // repositories
    apply from: "${rootProject.projectDir}/repositories.gradle" 
}

subprojects {
    apply plugin: 'org.jetbrains.kotlin.jvm'

    // repositories
    apply from: "${rootProject.projectDir}/repositories.gradle"
}

dependencies {
    // Align versions of all Kotlin components
    implementation platform('org.jetbrains.kotlin:kotlin-bom')

    // Use the Kotlin JDK 8 standard library.
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'

    // Use the Kotlin test library.
    testImplementation 'org.jetbrains.kotlin:kotlin-test'

    // Use the Kotlin JUnit integration.
    testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'

    cordaCompile "net.corda:corda-core:4.9.2"
    cordaRuntime "net.corda:corda-node-api:4.9.2"
    cordaRuntime "net.corda:corda:4.9.2"
    cordaDriver "net.corda:corda-shell:4.9.2"
}

// TODO: learn how to use the new syntax `tasks.register()`
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
    nodeDefaults {
        projectCordapp {
            deploy = false
        }
    }

    node {
        name "O=Notary,L=London,C=GB"
        notary = [validating : false]
        p2pPort 10002
        rpcSettings {
            address("localhost:10003")
            adminAddress("localhost:10023")
        }
        projectCordapp {
            deploy = false
        }
        cordapps.clear()
        sshdPort 2222
    }
    node {
        name "O=PartyA,L=London,C=GB"
        p2pPort 10005
        rpcSettings {
            address("localhost:10006")
            adminAddress("localhost:10023")
        }
        rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
        sshdPort 2223
    }
}

Note that I’m not deploying any cordapps since what I want is a minimal working gradle solution. About the error, is there some lib I’m missing? Why does the deployNodes task on the examples (hosted on GH) are able to create the corda.jar file inside build/nodes/<node_name> but mine doesn’t?

The error in the title was being caused by the value of the buildscript.ext.corda_release_version setting. It must not be a literal number, but rather a string:

buildscript {
    ext {
        corda_release_version = "4.9.2" // or "4.9"
    }
}

While this fixes the original error, another error will be thrown because some dependencies to run the nodes are still missing, they are:

dependencies {
    // ... all other corda dependencies

    cordaCompile "org.apache.logging.log4j:log4j-slf4j-impl:2.18.0"
    cordaCompile "org.apache.logging.log4j:log4j-web:2.18.0"
    cordaCompile "org.slf4j:jul-to-slf4j:2.0.0"
}

Please note that these dependencies are declared using the latest version (as of this writing) and may not work. In fact, when I run deployNodes task I got some warnings related to SLF4J dep:

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8.
SLF4J: Ignoring binding found at [jar:file:/home/userName/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.18.0/e0ea6ef49f1349bb30e8c6e8a7052d0f3ee7a719/log4j-slf4j-impl-2.18.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#ignoredBindings for an explanation.

It may be safer to just copy the dependencies version declared in the constants.properties file in the Corda examples.