Black Duck fails to run gradlew dependencies successfully

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&gt']
  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.


The problem was I was using an older version of the Black Duck detect.sh script. I was using version 6.9.1. Once I upgraded to using version 7.6.0, the Black Duck scan worked once more.

To use the new version of the script, you can do the following (note the detect7.sh in the URL; if you download plain detect.sh you will get an old version):

curl --fail https://detect.synopsys.com/detect7.sh -o detect.sh
export DETECT_LATEST_RELEASE_VERSION=7.6.0
bash detect.sh <args>