Since upgrading from Gradle 6.7.1 to 7.0 (which may be a red herring), Black Duck scans of my Gradle project now fail.
Here is the error message:
* Where: Initialization script '/root/blackduck/runs/2022-01-18-19-06-00-216/shared/gradle/init-detect.gradle' line: 40 * What went wrong: Execution failed for task ':dependencies'. > 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 '<redacted>'] Possible solutions: startProject(org.gradle.api.tasks.diagnostics.internal.ProjectDetails), startProject(org.gradle.api.tasks.diagnostics.internal.ProjectDetails)
Builds are successful when the Gradle build is run without Black Duck.
The Black Duck scan is run with the following command:
bash detect.sh --blackduck.url=<redacted> --blackduck.trust.cert=true --blackduck.api.token=<redacted> --detect.project.name=<redacted> --detect.project.version.name=Developer --detect.source.path=.
Here is my full build.gradle
:
buildscript {
repositories {
maven {
url "https://<redacted>/nexus/repository/maven-central"
}
maven {
url "https://<redacted>/nexus/repository/thirdparty"
}
maven {
url "https://<redacted>/nexus/repository/gradle-plugins"
}
}
}
plugins {
id "java"
}
def nexusUsername = (System.getenv("NEXUS_USERNAME") != null ? System.getenv("NEXUS_USERNAME") : (project.hasProperty('NEXUS_USERNAME') ? "$NEXUS_USERNAME" : ""))
def nexusPassword = (System.getenv("NEXUS_PASSWORD") != null ? System.getenv("NEXUS_PASSWORD") : (project.hasProperty('NEXUS_PASSWORD') ? "$NEXUS_PASSWORD" : ""))
repositories {}
ext {}
dependencies {}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
sourceCompatibility = 11
targetCompatibility = 11
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
}
}
My ideas for what could be wrong:
- There is a bug in the auto-generated
/root/blackduck/runs/2022-01-18-19-06-00-216/shared/gradle/init-detect.gradle
file (maybe Black Duck doesn't play nice with Gradle 7.0) - I run the
detect.sh
script with the wrong arguments - There is something wrong with my
build.gradle
file
I am looking for any suggestions on how to solve this problem so that my Black Duck scans can run successfully once more.