No signature of method startProject()

Hello. My build fails with this error:

Execution failed for task ':dependencies'.
DEBUG [main-Executable_Stream_Thread] --- > No signature of method: org.gradle.api.tasks.diagnostics.internal.dependencies.AsciiDependencyReportRenderer.startProject() is applicable for argument types: (org.gradle.api.internal.project.DefaultProject_Decorated) values: [root project 'my-project']
DEBUG [main-Executable_Stream_Thread] ---   Possible solutions: startProject(org.gradle.api.tasks.diagnostics.internal.ProjectDetails), startProject(org.gradle.api.tasks.diagnostics.internal.ProjectDetails)

I saw similar issue and solution there: forum topic, and I also have Gradle 6.8.3, but in my case, I don’t understand where I should put “ProjectDetails projectDetails = ProjectDetails.of(project)”, if I don’t have such code.
My " settings.gradle" is empty. Here is " build.gradle.kts" file:

buildscript {
    repositories {
        maven("https://myartifactory/gradle-dev/") {
            credentials {
                username = System.getenv("ARTIFACTORY_USR")
                password = System.getenv("ARTIFACTORY_PSW")
            }
        }
        mavenLocal()
    }

    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:2.3.1.RELEASE")
        classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8")
    }
}

apply {
    plugin("org.sonarqube")
    plugin("jacoco")
}

plugins {
    val kotlinVersion = "1.3.72"
    id("java-library")
    id("com.jfrog.artifactory") version "4.15.2"
    id("io.spring.dependency-management") version "1.0.9.RELEASE"
    id("maven-publish")
    id("org.springframework.boot") version "2.3.1.RELEASE"
    kotlin("jvm") version kotlinVersion
    kotlin("plugin.spring") version kotlinVersion
    id("org.jetbrains.kotlin.kapt") version kotlinVersion
    id("org.sonarqube") version "2.8"
    id("jacoco")
    idea
}

repositories {
    maven("https://myartifactory/gradle-dev/") {
        credentials {
            username = System.getenv("ARTIFACTORY_USR")
            password = System.getenv("ARTIFACTORY_PSW")
        }
    }
    mavenLocal()
}

val cordaVersion = "4.8.6"

dependencies {
    implementation("jakarta.validation:jakarta.validation-api:2.0.2")
    implementation("org.springframework.boot:spring-boot")
    implementation("org.springframework.boot:spring-boot-starter-web")
    implementation("org.springframework.boot:spring-boot-autoconfigure")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    implementation("net.logstash.logback:logstash-logback-encoder:6.1")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
    compileOnly("com.fasterxml.jackson.module:jackson-module-kotlin")
    implementation("commons-io:commons-io:2.8.0")
    implementation("org.apache.commons:commons-configuration2:2.7.0.redhat-00001")
    implementation("net.corda:corda-core:$cordaVersion")

    implementation("org.apache.logging.log4j:log4j-api:2.17.1")
    implementation("org.apache.logging.log4j:log4j-to-slf4j:2.17.1")

    kapt("org.springframework.boot:spring-boot-configuration-processor")
    annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")

    testImplementation("com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.3")
    testImplementation("io.mockk:mockk:1.9.3")
    testImplementation("org.springframework.boot:spring-boot-starter-test") {
        exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
    }
    testImplementation("org.junit.jupiter:junit-jupiter-api")
}

jacoco {
    toolVersion = "0.8.7"
}

sonarqube {
    properties {
        property("sonar.projectBaseDir", "$projectDir")
        property("sonar.projectKey", "tradeix_${System.getenv("SERVICE_NAME")}")
        property("sonar.organization", "tradeix1")
        property("sonar.login", System.getenv("SONAR_TOKEN"))
        property("sonar.host.url", System.getenv("SONAR_HOST_URL"))
        property("sonar.sources","src/main")
        property("sonar.tests","src/test")
        property("sonar.coverage.jacoco.xmlReportPaths","build/reports/jacoco/test/jacocoTestReport.xml")
        val pattern = "PR-*".toRegex()
        if ( pattern.containsMatchIn(System.getenv("BRANCH_NAME"))) {
            property("sonar.pullrequest.base", System.getenv("CHANGE_TARGET"))
            property("sonar.pullrequest.branch", System.getenv("CHANGE_BRANCH"))
            property("sonar.pullrequest.key", System.getenv("CHANGE_ID"))
        }
    }
}

tasks.jacocoTestReport {
    reports {
        xml.isEnabled = true
        csv.isEnabled = true
    }
}

artifactory {
    setContextUrl(System.getenv("ARTIFACTORY_URL"))
    publish(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> {
        repository(delegateClosureOf<groovy.lang.GroovyObject> {
            setProperty("repoKey", "gradle-dev-local")
            setProperty("username", System.getenv("ARTIFACTORY_USR"))
            setProperty("password", System.getenv("ARTIFACTORY_PSW"))
            setProperty("maven", true)
        })
        defaults(delegateClosureOf<groovy.lang.GroovyObject> {
            invokeMethod("publications", "mavenJava")
            setProperty("publishPom", true)
            setProperty("publishArtifacts", true)
        })

    })
}

tasks {
    java.sourceCompatibility = JavaVersion.VERSION_1_8

    tasks.takeIf { it.name.contains(PublishingPlugin.PUBLISH_LIFECYCLE_TASK_NAME, true) }
        ?.map { it.mustRunAfter(kotlinSourcesJar) }

    val sourcesJar by creating(Jar::class) {
        archiveClassifier.set("sources")
        from(sourceSets["main"].allSource)
        dependsOn(JavaPlugin.CLASSES_TASK_NAME)
    }

    artifacts.add("archives", sourcesJar)

    compileKotlin {
        kotlinOptions {
            freeCompilerArgs = listOf("-Xjsr305=strict")
            jvmTarget = "1.8"
            javaParameters = true
        }
    }

    compileJava.configure { inputs.files(processResources) }

    jar {
        manifest {
            attributes(
                "Created-By" to "${System.getProperty("java.version")} ${System.getProperty("java.vendor")} ${System.getProperty(
                    "java.vm.version"
                )}",
                "Built-by" to "jenkins",
                "Build-OS" to System.getProperty("os.name"),
                "Implementation-Version" to project.version,
                "Implementation-Name" to project.name,
                "Implementation-Type" to "spring-boot-starter"
            )
        }
        enabled = true
    }

    bootJar { enabled = false }

    test {
        useJUnitPlatform()
        testLogging {
            showStandardStreams = true
            exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
            showExceptions = true
            showCauses = true
            showStackTraces = true
        }
    }
}

publishing {
    publications {
        register("mavenJava", MavenPublication::class) {
            from(components.findByName("java"))
            artifacts.artifact(tasks["sourcesJar"])
        }
    }
}

What does the stack trace say where this comes from? (--stacktrace)

only this:
Settings evaluated using settings file ‘/home/****/agent/workspace/my_job/settings.gradle’.

Projects loaded. Root project using build file ‘/home/****/agent/workspace/my_job/build.gradle.kts’.

That is not a stack trace

I found a root cause. It was related to an incorrect version of Gradle distribution in gradle-wrapper.properties file.
here is the content of that file

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

It didn’t with “gradle-6.8.3-bin.zip” (same as Gradle version), but worked with 5.6.4

What do you mean with “same as Gradle version”?
As which Gradle version?
If you have the four wrapper files in the project (which imho each and every Gradle project should have), this line defines which Gradle version is used to write the build and thus is used to run the build, to prevent any incompatibilities due to different Gradle versions being used to run the build.
You of course also have to use the gradlew scripts to run the build and not some installed Gradle version, unless you make sure it is the same version as defined in the wrapper file.