BlackDuck Detect exit code 0 failing build

matt_mckinstry's Avatar


23 Jan, 2020 11:17 AM

We are trying to run BlackDuck detect using the following

Invoke-RestMethod$(Get-Random) | iex; detect

Detect runs as it should but it is failing our build with "Command exited with code"

Detect Powershell Script 2.3.0
Checking if Java is installed by asking for version.
Java Source: JAVA_HOME/bin/java=C:\Progra~1\Java\jdk1.8.0/bin/java
Java Standard Output:
Java Error Output: java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
Successfully able to start java and get version.
Initializing Detect folder.
Using system temp folder: C:\Users\appveyor\AppData\Local\Temp\1
Checking for proxy.
Skipping proxy, no host found.
Getting Detect.
Finding latest Detect version.
Using Detect source
Using Detect Version 6.1.0
Detect jar exists 'False'
You don't have Detect. Downloading now.
Using url
Downloaded Detect jar successfully 'True'
Executing Detect.
Running Detect: "-jar" "C:\Users\appveyor\AppData\Local\Temp\1/synopsys-detect-6.1.0.jar"
Java Source: JAVA_HOME/bin/java=C:\Progra~1\Java\jdk1.8.0/bin/java
Result code of 0, exiting
Command exited with code

Any ideas how i can make this run without tripping our build?

  1. 1 Posted by matt_mckinstry on 23 Jan, 2020 12:28 PM

    matt_mckinstry's Avatar

    Ive worked around this by:

    Environment variable

    $BlackDuckExitCode = 0

    Invoke-RestMethod$(Get-Random) | iex; $BlackDuckExitCode = detect

    if($BlackDuckExitCode -ne 0) { $host.SetShouldExit($BlackDuckExitCode ) }

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac