Git Product home page Git Product logo

hub-detect's Introduction

hub-detect's People

Contributors

bamandel avatar ekerwin avatar foosbar avatar jakemathews avatar jamesrichard91 avatar nmfaulkner avatar patrickwilliamconway avatar rickity-cricket avatar rmannibucau avatar romeara avatar rottebds avatar s0 avatar stavvy-akamen avatar sturdy5 avatar taikuukaits avatar utsavsanghani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hub-detect's Issues

test

Issue template

Expected behavior

Actual behavior

Steps to Reproduce

Version

Project Version:

Language Version:

OS:

test2

Issue template

Expected behavior

Actual behavior

Steps to Reproduce

Version

Project Version:

Language Version:

OS:

  • win

Hub detect fails to parse python requirements.txt file when using pip v10.0

Issue template

Expected behavior

  • Hub detect's pip inspector parses the requirements.txt file.

Actual behavior

  • The inspector fails to parse the requirements.txt file.
  • This is because in pip 10.0 all the API's got moves to pip._internal.
    See https://pip.pypa.io/en/stable/news/ under 10.0.0b1, Deprecations and Removals.
    Notice that in pip-inspector.py we use the parse_requirements and PipSession calls which have moved in 10.0. I'm going to propose a fix (in Github) but wanted to record this in case someone else comes across it while we work out how best to fix it.

Steps to Reproduce

  • Install pip 10.x
  • Run hub detect with the pip inspector on any (valid) requirements.txt file

Version

Affects Hub detect v3.2.0 and prior versions

Language Version:
Applies to python environments using pip 10.x

OS:
I think this issue affects all OS's but I specifically am using OSX (High Sierra)

Add a parameter for Detect Jar location

It would be really helpful to be able to specify a parameter for where to download the hub-detect jar from, that way I could reference a local Artifactory instead of downloading over the web. I'd also like a way to avoid the latest-commit-id.txt downloading directly from the web.

Can't set Code Location/Scan names

I'm in the process of creating a TeamCity plugin that configures and runs hub detect.

It appears that code location names are always set to {dirname ./..}/{Project Name}/{Project Version}{/bom| scan}.

When TeamCity clones a repository it places it into an arbitrarily named folder, hub-detect then uses this name for the uploaded code location. When the repository is cloned into a different folder, hub-detect does not clear the old code locations because the names no longer match.

I've tried the following settings to see if I could change the behavior:

// SPRING_APPLICATION_JSON
{
"detect.project.codelocation.delete.old.names":"true",
"detect.source.path":".",
"detect.project.codelocation.prefix":"JustATest"
}

//Loaded as
sourcePath = <snip>/buildAgent/work/1da1958be684ed96 [.]
projectCodeLocationDeleteOldNames = true
projectCodeLocationPrefix = JustATest

Is there a setting that I've glossed over or another work around?

git-describe trimming needs to be refined

the intent here is to convert strings like v1.0.0-10-gae3452 to v1.0.0

however, the current implemention would trounce on a legit tag name like v1.0.0-alpha-3

the right pattern to search for and replace is -\d+-g[0-9a-f]+$ - the anchoring pattern here is the g preceding the short commit hash`

suggesting shell hash symbol in hub-detect.sh to make the line a comment

Expected behavior

execute hub-detect.sh to create the BoM

Actual behavior

BoM is not created as hub-detect.sh exits early with an error.

Steps to Reproduce

download hub-detect.sh via suggested curl command
run make hub-detect.sh executable

./hub-detect.sh: line 9: hub-detect.sh: command not found

Version

Project Version:
version at master branch on 2018-10-11

Language Version:
English

OS:
linux

NugetInspectorExtractor.extract throws a NullPointerException, hub-detect ends with NoSuchElementException "error in MERGING"

Expected behavior

  • No failure in running hub-detect.

Actual behavior

  • Failure.

Steps to Reproduce

08:48:53 [Open-Source Governance] 2018-12-13 08:48:53 INFO [main] --- Starting extraction: NUGET - Project
08:48:53 [Open-Source Governance] 2018-12-13 08:48:53 INFO [main] --- Identifier: NUGET-6
08:48:53 [Open-Source Governance] 2018-12-13 08:48:53 INFO [main] --- 
------------------------------------------------------------------------------------------------------
08:48:53 [Open-Source Governance] 2018-12-13 08:48:53 INFO [main] --- Running executable >C:\Program Files\dotnet\dotnet.exe C:\Users\AZXXXXXServic\blackduck\tools\nuget\BlackduckNugetInspector.0.0.6\tools\BlackduckNugetInspector.dll --target_path=.\xunit.test --output_directory=C:\Users\AZXXXXXServic\blackduck\runs\2018-12-13-13-48-45-138\extractions\NUGET-6 --ignore_failure=false --excluded_modules=Nothing_To_Exclude --packages_repo_url=https://api.nuget.org/v3/index.json --nuget_config_path=./nuget.config
08:48:53 [Open-Source Governance] 2018-12-13 08:48:53 INFO [main-Executable_Stream_Thread] --- Nuget config path did not exist.
08:48:54 [Open-Source Governance] 2018-12-13 08:48:54 INFO [main-Executable_Stream_Thread] --- Succesfully added dependency info resource: https://api.nuget.org/v3/index.json
08:48:54 [Open-Source Governance] 2018-12-13 08:48:54 INFO [main] --- Executable finished: 0
08:48:54 [Open-Source Governance] 2018-12-13 08:48:54 INFO [main] --- ------------------------------------------------------------------------------------------------------
08:48:54 [Open-Source Governance] 2018-12-13 08:48:54 INFO [main] --- Finished extraction: EXCEPTION
08:48:54 [Open-Source Governance] 2018-12-13 08:48:54 INFO [main] --- Code locations found: 0
08:48:54 [Open-Source Governance] 2018-12-13 08:48:54 ERROR [main] --- Exception:
08:48:54 [Open-Source Governance]
08:48:54 [Open-Source Governance] java.lang.NullPointerException: null
08:48:54 [Open-Source Governance] at com.blackducksoftware.integration.hub.detect.detector.nuget.NugetInspectorExtractor.extract(NugetInspectorExtractor.java:112) ~[classes!/:na]
08:48:54 [Open-Source Governance] at com.blackducksoftware.integration.hub.detect.detector.nuget.NugetProjectDetector.extract(NugetProjectDetector.java:123) ~[classes!/:na]
08:48:54 [Open-Source Governance] at com.blackducksoftware.integration.hub.detect.workflow.extraction.ExtractionManager.extract(ExtractionManager.java:89) [classes!/:na]
08:48:54 [Open-Source Governance] at com.blackducksoftware.integration.hub.detect.workflow.extraction.ExtractionManager.performExtractions(ExtractionManager.java:60) [classes!/:na]
08:48:54 [Open-Source Governance] at com.blackducksoftware.integration.hub.detect.workflow.detector.DetectorManager.runDetectors(DetectorManager.java:73) [classes!/:na]
08:48:54 [Open-Source Governance] at com.blackducksoftware.integration.hub.detect.tool.detector.DetectorTool.performDetectors(DetectorTool.java:70) [classes!/:na]
08:48:54 [Open-Source Governance] at com.blackducksoftware.integration.hub.detect.lifecycle.run.RunManager.run(RunManager.java:130) [classes!/:na]
08:48:54 [Open-Source Governance] at com.blackducksoftware.integration.hub.detect.Application.run(Application.java:114) [classes!/:na]
08:48:54 [Open-Source Governance] at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:788) [spring-boot-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
08:48:54 [Open-Source Governance] at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:778) [spring-boot-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
08:48:54 [Open-Source Governance] at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) [spring-boot-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
08:48:54 [Open-Source Governance] at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:137) [spring-boot-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
08:48:54 [Open-Source Governance] at com.blackducksoftware.integration.hub.detect.Application.main(Application.java:77) [classes!/:na]
08:48:54 [Open-Source Governance] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
08:48:54 [Open-Source Governance] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_191]
08:48:54 [Open-Source Governance] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_191]
08:48:54 [Open-Source Governance] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_191]
08:48:54 [Open-Source Governance] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [hub-detect-5.0.1.jar:na]
08:48:54 [Open-Source Governance] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [hub-detect-5.0.1.jar:na]
08:48:54 [Open-Source Governance] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [hub-detect-5.0.1.jar:na]
08:48:54 [Open-Source Governance] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [hub-detect-5.0.1.jar:na]

...


08:49:04 [Open-Source Governance] 2018-12-13 08:49:03 INFO [main] --- Waiting for the BOM to be updated
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 ERROR [main] --- Detect run failed.
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 ERROR [main] --- There was a problem: There was a problem in the Hub processing the scan(s). Error Status : ERROR, Error in MERGING, java.util.NoSuchElementException [b81242c2-8bdc-474c-a3c2-2006ec361b26]
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Detect will attempt to shutdown.
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Detect shutdown begin.
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Detect will cleanup.
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Detect shutdown completed.
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- All detect actions completed.
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] ---
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- ======================================================================================================
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Detector Issue Summary
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- ======================================================================================================
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- .\ACS.console
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Exception: NUGET - Project
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- java.lang.NullPointerException
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- .\ACS.service
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Exception: NUGET - Project
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- java.lang.NullPointerException
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- .\IC.api
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Exception: NUGET - Project
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- java.lang.NullPointerException
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- .\IC.console
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Exception: NUGET - Project
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- java.lang.NullPointerException
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- .\IC.service
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Exception: NUGET - Project
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- java.lang.NullPointerException
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- .\xunit.test
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Exception: NUGET - Project
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- java.lang.NullPointerException
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- ======================================================================================================
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] ---
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] ---
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] ---
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- ======== Detect Results ========
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- NUGET: FAILURE
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Overall Status: FAILURE_DETECTOR
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- ================================
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] ---
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 INFO [main] --- Detect duration: 00h 00m 19s 108ms
08:49:04 [Open-Source Governance] 2018-12-13 08:49:04 ERROR [main] --- Exiting with code 5 - FAILURE_DETECTOR

Versions

  • HubDetect 5.0.1
  • DotNet Core
  • BlackduckNugetInspector 0.0.6
  • Windows 2012

The powershell script changed the default way of indicating the result code

Expected behavior

  • Running the following CMD.EXE command should return the failure on failing the security policy,
    powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command $VerbosePreference = 'Continue'^; $DebugPreference = 'Continue'^; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12^; irm https://blackducksoftware.github.io/hub-detect/hub-detect.ps1?$(Get-Random) ^| iex^; detect --blackduck.hub.url=\"https://XXX.blackducksoftware.com/\" ... --detect.policy.check.fail.on.severities=\"ALL\" ...

Actual behavior

  • Due to a change in the powershell hub-detect.ps1 script contents which was not reflected in this repository's resources/hub-detect-ps, the default behaviour switched from exiting the script to returning its value. While this change has an advantage of enabling integration with wrapping powershell calls, the basic invokation as shown above suffered. It receives an exit code of 0 when the Detect function returns a non-zero value. Besides, Powershell "return" statement may trick newbies if the code path preceding it included any "echo" statements, according to Manoj Mahalingam,
    https://stacktoheap.com/blog/2013/06/15/things-that-trip-newbies-in-powershell-pipeline-output/

Steps to Reproduce

  • The production change
 # If you do not want to exit with the detect exit code,
 # set DETECT_EXIT_CODE_PASSTHRU to 1 and this script won't exit, but simply return it (pass it thru).
-$EnvDetectExitCodePassthru = Get-EnvironmentVariable -Key "DETECT_EXIT_CODE_PASSTHRU" -DefaultValue "";
+$EnvDetectExitCodePassthru = Get-EnvironmentVariable -Key "DETECT_EXIT_CODE_PASSTHRU" -DefaultValue "1";
  • Behaviour before the change in the production script
C:\Temp>type foo.ps1
function Detect {
    exit 123
}

C:\Temp>powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command $VerbosePreference = 'Continue'^; $DebugPreference = 'Continue'^; . .\foo.ps1^; detect

C:\Temp>echo %errorlevel%
123

C:\Temp>powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command $VerbosePreference = 'Continue'^; $DebugPreference = 'Continue'^; . .\foo.ps1^; exit detect

C:\Temp>echo %errorlevel%
123
  • Behaviour after the change in the production script
C:\Temp>type foo.ps1
function Detect {
    return 123
}

C:\Temp>powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command $VerbosePreference = 'Continue'^; $DebugPreference = 'Continue'^; . .\foo.ps1^; detect
123

C:\Temp>echo %errorlevel%
0

C:\Temp>powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command $VerbosePreference = 'Continue'^; $DebugPreference = 'Continue'^; . .\foo.ps1^; exit detect

C:\Temp>echo %errorlevel%
123

Version

OS

  • Windows 7+

Scan Gradle file without building

I think that today in order to scan Gradle files, hub-detect will try first to build them. Why is that? I don't think this is necessary, and it will make things a lot simpler. Also it look like VersionEye is able to scan Gradle files without compiling - and it is working pretty good.

Pip scanning fails with message

Issue template

Expected behavior

  • Pip scanning completes successfully

Actual behavior

  • Pip scanning fails with this message:
[1m2020-10-19 07:10:58�[0m 2020-10-19 07:10:58 INFO  [main-Executable_Stream_Thread] --- Traceback (most recent call last):
�[1m2020-10-19 07:10:58�[0m 2020-10-19 07:10:58 INFO  [main-Executable_Stream_Thread] ---   File "/home/jenkins/blackduck/runs/***********/shared/pip/pip-inspector.py", line 33, in <module>
�[1m2020-10-19 07:10:58�[0m 2020-10-19 07:10:58 INFO  [main-Executable_Stream_Thread] ---     from pip._internal.download import PipSession
�[1m2020-10-19 07:10:58�[0m 2020-10-19 07:10:58 INFO  [main-Executable_Stream_Thread] --- ModuleNotFoundError: No module named 'pip._internal.download'
�[1m2020-10-19 07:10:58�[0m 2020-10-19 07:10:58 INFO  [main] --- Executable finished: 1
�[1m2020-10-19 07:10:58�[0m 2020-10-19 07:10:58 INFO  [main] --- ------------------------------------------------------------------------------------------------------
�[1m2020-10-19 07:10:58�[0m 2020-10-19 07:10:58 INFO  [main] --- Finished extraction: FAILURE
�[1m2020-10-19 07:10:58�[0m 2020-10-19 07:10:58 INFO  [main] --- Code locations found: 0
�[1m2020-10-19 07:10:58�[0m 2020-10-19 07:10:58 INFO  [main] --- The Pip Inspector tree parse failed to produce output

Steps to Reproduce

  • Run any scan job while using pip version greater or equal to 20

Version

  • pip version 20.2.4

Language Version:

  • Python 3.7
    OS:

  • Ubuntu 18.04.2 LTS

PS: We believe that the issue can be resolved by replacing in your script pip-inspector.py "from pip._internal.download import PipSession" with "from pip._internal.network.session import PipSession".

Allow to choose which packagers to run

Let's say I have multiple packages files - for example when working on iOS with Cocoapod, you probably have Podfile. You might also have Gemfile in the same folder, so you could easily install tools like Fastlane. Now, when scanning my iOS project, I want to scan only the Podfile - I don't care about the Gemfile. It would be nice to be able to specify which scanners to run.

[Feature] Carthage Support

Issue template

Expected behavior

  • Hub-Detect should be able to scan Carthage files.

Actual behavior

  • Hub-Detect doesn't currently scan Carthage files.

Steps to Reproduce

  • Create an iOS project and attempt to scan it.

Version

Project Version:
4.5.0
*
Language Version:
N/A
*
OS:
macOS
*

NullPointerException was caught during scan with compile_commands.json file

Expected behavior

  • No exception

Actual behavior

  • Caught exception as below:
2018-10-17 11:08:46 ERROR [main] --- Exception:
java.lang.NullPointerException: null
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_181]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_181]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_181]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_181]
        at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598) ~[na:1.8.0_181]
        at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677) ~[na:1.8.0_181]
        at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:735) ~[na:1.8.0_181]
        at java.util.stream.ReduceOps$ReduceOp.evaluateParallel(ReduceOps.java:714) ~[na:1.8.0_181]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) ~[na:1.8.0_181]
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[na:1.8.0_181]
        at com.blackducksoftware.integration.hub.detect.bomtool.clang.ClangExtractor.extract(ClangExtractor.java:92) ~[classes!/:na]
        at com.blackducksoftware.integration.hub.detect.bomtool.clang.ClangBomTool.extract(ClangBomTool.java:84) ~[classes!/:na]
        at com.blackducksoftware.integration.hub.detect.workflow.extraction.ExtractionManager.extract(ExtractionManager.java:98) [classes!/:na]
        at com.blackducksoftware.integration.hub.detect.workflow.extraction.ExtractionManager.extract(ExtractionManager.java:67) [classes!/:na]
        at com.blackducksoftware.integration.hub.detect.workflow.extraction.ExtractionManager.performExtractions(ExtractionManager.java:121) [classes!/:na]
        at com.blackducksoftware.integration.hub.detect.workflow.DetectProjectManager.createDetectProject(DetectProjectManager.java:104) [classes!/:na]
        at com.blackducksoftware.integration.hub.detect.Application.runDetect(Application.java:222) [classes!/:na]
        at com.blackducksoftware.integration.hub.detect.Application.run(Application.java:136) [classes!/:na]
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:788) [spring-boot-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
        at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:778) [spring-boot-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) [spring-boot-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:137) [spring-boot-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
        at com.blackducksoftware.integration.hub.detect.Application.main(Application.java:125) [classes!/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [hub-detect-4.3.2.jar:na]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [hub-detect-4.3.2.jar:na]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [hub-detect-4.3.2.jar:na]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [hub-detect-4.3.2.jar:na]
Caused by: java.lang.NullPointerException: null
        at com.blackducksoftware.integration.hub.detect.bomtool.clang.DependenciesListFileManager.getCompilerCommand(DependenciesListFileManager.java:120) ~[classes!/:na]
        at com.blackducksoftware.integration.hub.detect.bomtool.clang.DependenciesListFileManager.generate(DependenciesListFileManager.java:71) ~[classes!/:na]
        at com.blackducksoftware.integration.hub.detect.bomtool.clang.DependenciesListFileManager.generateDependencyFilePaths(DependenciesListFileManager.java:60) ~[classes!/:na]
        at com.blackducksoftware.integration.hub.detect.bomtool.clang.ClangExtractor.lambda$compileCommandToDependencyFilePathsConverter$0(ClangExtractor.java:112) ~[classes!/:na]
        at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267) ~[na:1.8.0_181]
        at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:1.8.0_181]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[na:1.8.0_181]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[na:1.8.0_181]
        at java.util.stream.ReduceOps$ReduceTask.doLeaf(ReduceOps.java:747) ~[na:1.8.0_181]
        at java.util.stream.ReduceOps$ReduceTask.doLeaf(ReduceOps.java:721) ~[na:1.8.0_181]
        at java.util.stream.AbstractTask.compute(AbstractTask.java:316) ~[na:1.8.0_181]
        at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) ~[na:1.8.0_181]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[na:1.8.0_181]
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[na:1.8.0_181]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[na:1.8.0_181]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) ~[na:1.8.0_181]

Steps to Reproduce

  • Generate the compile_commands.json file with either 'compiledb' or 'Bear' for a makefile-based C/C++ project
  • Perform the hub-detect scan

Version

Project Version:

  • 4.3.2

Language Version:

  • openjdk version "1.8.0_181"
    OpenJDK Runtime Environment (build 1.8.0_181-b13)
    OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

OS:

  • Centos 7

Not detecting NPM dependencies

I'm trying to run Hub Detect on a project with bothnpm-shrinkwrap.json and package.json files present in the root of the directory. Instead of the usual logging on successful scans, it runs, detects the OS, then closes out.

Interestingly, when running the scanner on a project with just a package.json, it detects the correct configuration and successfully scans. Any idea why this would be happening?

Logs:

[10:18:16]Step 2/2: Run Black Duck Hub Detect (Command Line) (4s)
[10:18:16][Step 2/2] Starting: /home/buildagent/buildAgent/temp/agentTmp/custom_script6823763653112255195
[10:18:16][Step 2/2] in directory: /home/buildagent/buildAgent/work/d3f4ccac47328f58
[10:18:16][Step 2/2]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[10:18:16][Step 2/2]                                  Dload  Upload   Total   Spent    Left  Speed
[10:18:16][Step 2/2]   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[10:18:16][Step 2/2] 100    41  100    41    0     0    545      0 --:--:-- --:--:-- --:--:--   546
[10:18:16][Step 2/2] will look for release: hub-detect-0.0.5.jar
[10:18:16][Step 2/2] You have already downloaded the latest file, so the local file will be used.
[10:18:16][Step 2/2] running detect: java -jar /tmp/hub-detect-0.0.5.jar 
[10:18:17][Step 2/2] 
[10:18:17][Step 2/2]   .   ____          _            __ _ _
[10:18:17][Step 2/2]  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
[10:18:17][Step 2/2] ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
[10:18:17][Step 2/2]  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
[10:18:17][Step 2/2]   '  |____| .__|_| |_|_| |_\__, | / / / /
[10:18:17][Step 2/2]  =========|_|==============|___/=/_/_/_/
[10:18:17][Step 2/2]  :: Spring Boot ::        (v1.5.2.RELEASE)
[10:18:17][Step 2/2] 
[10:18:18][Step 2/2] 2017-07-06 10:18:05.238  INFO 32298 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2aaf7cc2: startup date [Thu Jul 06 10:18:05 EDT 2017]; root of context hierarchy
[10:18:19][Step 2/2] 2017-07-06 10:18:06.299  INFO 32298 --- [           main] c.b.i.h.d.u.e.ExecutableManager          : You seem to be running in a LINUX operating system.
[10:18:19][Step 2/2] 2017-07-06 10:18:07.184  INFO 32298 --- [           main] c.b.integration.hub.detect.Application   : Configuration processed completely.
[10:18:19][Step 2/2] 
[10:18:19][Step 2/2] Current property values:
[10:18:19][Step 2/2] ------------------------------------------------------------
[10:18:19][Step 2/2] cleanupBdioFiles = true
[10:18:19][Step 2/2] cleanupBomToolFiles = true
[10:18:19][Step 2/2] createVirtualEnv = true
[10:18:19][Step 2/2] dockerInspectorVersion = 0.0.4
[10:18:19][Step 2/2] gradleBuildCommand = dependencies
[10:18:19][Step 2/2] gradleCleanupBuildBlackduckDirectory = true
[10:18:19][Step 2/2] gradleInspectorVersion = 0.0.7
[10:18:19][Step 2/2] hubPassword = *************
[10:18:19][Step 2/2] hubTimeout = 120
[10:18:19][Step 2/2] hubUrl = **********
[10:18:19][Step 2/2] hubUsername = ci_scanner
[10:18:19][Step 2/2] loggingLevel = INFO
[10:18:19][Step 2/2] mavenAggregateBom = true
[10:18:19][Step 2/2] nugetInspectorPackageName = IntegrationNugetInspector
[10:18:19][Step 2/2] nugetInspectorPackageVersion = 0.0.3-alpha
[10:18:19][Step 2/2] outputDirectoryPath = blackduck
[10:18:19][Step 2/2] policyCheck = true
[10:18:19][Step 2/2] policyCheckTimeout = 300000
[10:18:19][Step 2/2] projectName = $PROJECT_NAME
[10:18:19][Step 2/2] projectVersionName = In_Development
[10:18:19][Step 2/2] searchDepth = 10
[10:18:19][Step 2/2] sourcePaths = /home/buildagent/buildAgent/work/d3f4ccac47328f58
[10:18:19][Step 2/2] ------------------------------------------------------------
[10:18:19][Step 2/2] 
[10:18:20][Step 2/2] 2017-07-06 10:18:07.308  INFO 32298 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
[10:18:20][Step 2/2] 2017-07-06 10:18:07.323  INFO 32298 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2aaf7cc2: startup date [Thu Jul 06 10:18:05 EDT 2017]; root of context hierarchy
[10:18:20][Step 2/2] 2017-07-06 10:18:07.328  INFO 32298 --- [       Thread-2] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
[10:18:20][Step 2/2] Process exited with code 0

Spring Application JSON Environment variable:

(Formatted for better legibility)

{
  "detect.hub.url": "$BLACKDUCK_URL",
  "detect.hub.username": "$BLACKDUCK_USERNAME",
  "detect.hub.password": "$BLACKDUCK_PASSWORD",
  "detect.output.path": "blackduck",
  "detect.policy.check": "true",
  "detect.project.name": "$PROJECT_NAME",
  "detect.project.version.name": "Pre_Release"
}

Operating Systems Produced on:

  • Linux, version 3.13.0-32-generic
  • macOS 10.12.5

[Feature] 'yarn list --prod' support

Hi there,

I'm looking to add the above feature through a fork/pull-request and would like some guidance

I intend to add the ability for hub-detect to generate some bdio information from the output of the 'yarn list' command. To make this whole process easier, I thought I'd open a dialogue early to get your advice/recommendations/guidance.

Expected behavior

Take an argument (e.g. --detect.yarn.prod.only=true) and return/send bdio files to Black Duck

Actual behavior

Currently the tool only seems to support yarn.lock parsing, which is a bit over-zealous for external distribution projects

Having edited some of the code myself, I think I have a reasonable idea of the best way to achieve this, but would like some feedback from recent/regular contributors here. (CC: @ekerwin, @bamandel, @JakeMathews, etc)

Which data structure should be used to grab the CLI output?

I was trying to build a DependencyGraph, as is done in YarnPackager.groovy. There it is done through NameVersionNode objects. Is this the preferred way to build a parent-child data structure internally to hub-detect? Some detail here would be appreciated... This is best done through NVNBuilder? Is there a specific order in which linking should take place (parents added to root, then children to parent, or children to parent then parent to root? Does it matter?)? I assume grandchildren can be associated quite easily to existed parent-child relationships?

I also tried to use Dependency objects add them directly to a MutableDependencyGraph, but it seems this class is impossible to unit-test as it stands.
This would be my preferred method (making a simultaneous pull-request on integration-bdio for testability) but would this leave the resulting DependencyGraph without any essential information (e.g. linking data)?

Thanks for taking my bombardment of questions 😄 I'm just trying to open a dialogue because I would like to take a route you would prefer/expect (and I've gotten a bit lost in the data structures used for bdio 😏)

-- Jake

Use BDS_JAVA_HOME when calling Signature Scanner

Expected behavior

  • When Signature Scanner is invoked, the JVM located at BDS_JAVA_HOME is used to run Signature Scanner

Actual behavior

  • The Oracle JVM included in scan.cli.zip is used

Steps to Reproduce

  • Given JAVA_HOME is set, export BDS_JAVA_HOME=${JAVA_HOME}
  • Call hub-detect.sh

Version

Project Version: 4.2.1
OS: Alpine Linux

Fix

This is fixed in hub-common starting with version 38.2.0, so this issue can be fixed by updating the depency to hub-detect. Once hub-common is released, I can provide a PR if that helps.

npm names are parsed incorrectly (in Yarn at least)

When dealing with npmjs component names (of the format: name@version), I wanted to parse out the name. My initial thought was a naive one; "why not just split on the @ symbol?" but then I encountered something like this...

├─ @angular-devkit/[email protected]

Which didn't work... I recently attempted to update the yarn parsing to add production-only dependency support and, in the process, I added the following method to parse fuzzy names.

static String grabFuzzyName(String line) {
    // e.g.
    // ├─ [email protected] >> [email protected]
    // OR
    // │  ├─ tr46@~0.0.3 >> tr46@~0.0.3

    // [a-zA-Z\d-]+@.+[\dx]$
    Pattern pattern = Pattern.compile("[ \\d.\\-a-zA-Z]+@.+")
    Matcher matcher = pattern.matcher(line)
    matcher.find()
    String result = matcher.group(0).trim()

    result
}

It seems this method was removed and deemed unnecessary, but I found this via the hub:

image

Each of these corresponds to a component beginning with an @ symbol

image

@jamesrichard91

Thanks,
rickity-cricket

5.2.0 FAILURE_BLACKDUCK_FEATURE_ERROR

Issue template

Expected behavior

  • Blackduck scan completed successfully

Actual behavior

  • FAILURE_BLACKDUCK_FEATURE_ERROR on 5.2.0 (no issue with 5.1.0)

Steps to Reproduce

  • Run blackduck scan
  • (scan pull down 5.2.0 version)
  • FAILURE_BLACKDUCK_FEATURE_ERROR
  • Detect run failed: [Black Duck Error Message]: Not found /api/current-user.

Version

Project Version:
*
Language Version:

  • Java 8
    OS:
  • Circle CI Linux Build

Blackduck password is written to logs

Noticed it while running hub-detect today:

OmerL-Mac:soluto-home-app omerl$ bash <(curl -s https://blackducksoftware.github.io/hub-detect/hub-detect.sh)  --spring.config.location=application.properties nano
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    41  100    41    0     0    163      0 --:--:-- --:--:-- --:--:--   163
will look for release: hub-detect-0.0.4.jar
You have already downloaded the latest file, so the local file will be used.
running detect: /tmp/hub-detect-0.0.4.jar --spring.config.location=application.properties nano

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.2.RELEASE)

2017-06-21 07:11:23.695  INFO 53595 --- [           main] c.b.integration.hub.detect.Application   : Starting Application on OmerL-Mac with PID 53595 (/private/tmp/hub-detect-0.0.4.jar started by omerl in /Users/omerl/dev/soluto-home-app)
2017-06-21 07:11:23.703  INFO 53595 --- [           main] c.b.integration.hub.detect.Application   : No active profile set, falling back to default profiles: default
2017-06-21 07:11:23.925  INFO 53595 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@1888ff2c: startup date [Wed Jun 21 07:11:23 IDT 2017]; root of context hierarchy
2017-06-21 07:11:26.373  INFO 53595 --- [           main] c.b.i.h.d.u.e.ExecutableManager          : You seem to be running in a MAC operating system.
2017-06-21 07:11:26.915  INFO 53595 --- [           main] c.b.i.hub.detect.util.FileFinder         : No file detected: *.go in reactNativeSrc/ios
2017-06-21 07:11:26.918  INFO 53595 --- [           main] c.b.i.hub.detect.util.FileFinder         : No file detected: Gemfile.lock in reactNativeSrc/ios
2017-06-21 07:11:26.941  WARN 53595 --- [           main] c.b.i.hub.detect.bomtool.NugetBomTool    : The nuget executable must be on the path - are you sure you are running on a windows system?
2017-06-21 07:11:26.942  INFO 53595 --- [           main] c.b.i.hub.detect.BomToolManager          : COCOAPODS applies given the current configuration.
2017-06-21 07:11:27.900  INFO 53595 --- [           main] c.b.i.hub.detect.BomToolManager          : Creating 1 project nodes
2017-06-21 07:11:28.008  INFO 53595 --- [           main] c.b.i.hub.detect.BomToolManager          : BDIO Generated: /Users/omerl/dev/soluto-home-app/reactNativeSrc/iOS/COCOAPODS_ios_cocoapods_2017_06_21T07_11_27_702_bdio.jsonld
2017-06-21 07:11:28.022  INFO 53595 --- [           main] c.b.i.hub.detect.bomtool.GradleBomTool   : detect.gradle.path not set in config - first try to find the gradle wrapper
2017-06-21 07:11:28.028  INFO 53595 --- [           main] c.b.i.hub.detect.bomtool.GradleBomTool   : gradle wrapper not found - trying to find gradle on the PATH
2017-06-21 07:11:28.051  INFO 53595 --- [           main] c.b.i.hub.detect.BomToolManager          : GRADLE applies given the current configuration.
2017-06-21 07:11:28.094  INFO 53595 --- [           main] c.b.i.hub.detect.util.FileFinder         : No file detected: pom.xml in reactNativeSrc/ios
2017-06-21 07:11:28.097  INFO 53595 --- [           main] c.b.i.hub.detect.util.FileFinder         : No file detected: setup.py in reactNativeSrc/ios
2017-06-21 07:11:31.251  INFO 53595 --- [           main] c.b.integration.hub.detect.BdioUploader  : uploading COCOAPODS_ios_cocoapods_2017_06_21T07_11_27_702_bdio.jsonld to ***
--hub.url=***
--hub.timeout=120
--hub.username=***
--hub.password=***
--hub.project.name=test
--hub.project.version=1
--logging.level.com.blackducksoftware=INFO
2017-06-21 07:11:33.995  INFO 53595 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2017-06-21 07:11:34.056  INFO 53595 --- [           main] c.b.integration.hub.detect.Application   : Started Application in 11.818 seconds (JVM running for 15.06)
2017-06-21 07:11:34.057  INFO 53595 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@1888ff2c: startup date [Wed Jun 21 07:11:23 IDT 2017]; root of context hierarchy
2017-06-21 07:11:34.059  INFO 53595 --- [       Thread-2] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown

I added some masking myself now (password, username, hub url) - but in the log it appear without masking.

Hub-detect doesn't delete old code locations from a scan

I've found that when you set projectCodeLocationDeleteOldNames to true is does not carry down to the Scanner. Here are the logs from my build:

[22:10:15][Step 1/1] policyCheck = false
[22:10:15][Step 1/1] projectCodeLocationDeleteOldNames = true
[22:10:15][Step 1/1] projectLevelMatchAdjustments = true
...
[22:10:20][Step 1/1] 2018-04-10 22:10:20 INFO  [pool-2-thread-1] --- --> Un-map previous Code Locations : false
[22:10:20][Step 1/1] 2018-04-10 22:10:20 INFO  [pool-2-thread-1] --- --> Delete previous Code Locations : false

I believe you just need to carry the setting for deleting code locations down to this point and then call setDeletePreviousCodeLocations. It's possible this should also call setUnmapPreviousCodeLocations?

hubScanConfigBuilder.setSnippetModeEnabled(detectConfiguration.getHubSignatureScannerSnippetMode());

Gradle - gradleBuildCommand - Add Properties

Our build.gradle file needs properties (repository credentials) so that the "dependencies" task can be executed. I tried to add them to --detect.gradle.build.command but it doesn't work.

--detect.gradle.build.command="-PdeploymentPassword=**** -PdeploymentUsername=deployment -PspecificationVersion=16.1.0-SNAPSHOT dependencies"

Gradle gets the parameters as one argument and therefore this hack doesn't work. From my point of view it works if the parameters will be splitted.

URLs are broken for recent versions of Hub

Issue template

I suppose I'm not the only one to have this issue, but the valuable Black Duck URL posted into the logs fails to load the page correctly, and I'm required to workaround this problem by chopping the "/components" section of the URL.

Quite surprised this wasn't tested immediately with the new version as it's likely the first step of anyone running hub-detect.

Expected behavior

  • Click the link in the log output and see the project I just scanned to

Actual behavior

Page Not Found, but...
you've requested a valid API - Here's the output from that request.

image

Steps to Reproduce

  • Run hub detect with any new version of black duck
  • Click the URL in the log output

Version

Project Version:

Language Version:

OS:

Not accepting multiple gradle arguments (--detect.gradle.build.command)

Issue template

Expected behavior

  • The --detect.gradle.build.command= should accept multiple values.

Actual behavior

  • The --detect.gradle.build.command= only passes the first one provided through, all others after that are ignored.

Steps to Reproduce

  • Example below:

--detect.gradle.build.command=\"-PartifactoryUser=${env.ARTIFACTORY_USER} -PartifactoryPassword=${env.ARTIFACTORY_PASS}\"
This has escaped quotes because this sits inside double quotes already.

The result is that it ends up only passing through the first value when it runs gradle as seen below:
/gradlew -PartifactoryUser=xxxxx dependencies ....

This is using the version that it pulls down every time by CURLing - https://detect.synopsys.com/detect.sh

Version

Project Version:

  • 2.2.0
    Language Version:

  • Gradle
    OS:

  • CentOS

Windows support?

I tried today the Nuget scanner - but encounter the following error:

 WARN--- The nuget executable must be on the path - are you sure you are running on a windows system?

How can I run hub-detect on windows? Is there a powershell alternative to the shell script?

Respect JAVA_HOME in hub-detect.sh

hub-detect.sh assumes the java in the path is a Java 8 or later.

Our build nodes are set up with multiple Java versions, with Java 6 as the system default. So hub-detect.sh fails because of the Java 8 dependency. Changing the system default isn't desired.
If hub-detect.sh would respect JAVA_HOME or allow explicit definition of the java executable via an environment variable we could set up the post build task to use an alternative Java version.

Docker support?

I would like to run this tool from docker file - it will make it easier to run it in our CI server (no need to have any dependencies installed). Are you planning to support this? I can help with a PR, if that's acceptable.

Java 9 - hub-detect-1.2.0.jar doesn't work

hub-detect-1.2.0.jar doesn't work as expected if it will be executed by using Java 9.

hub-detect.sh output:
INFO--- Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@72cc7e6f: startup date [Thu Oct 19 08:00:00 CEST 2017]; root of context hierarchy INFO--- Registering beans for JMX exposure on startup INFO--- Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@72cc7e6f: startup date [Thu Oct 19 08:00:00 CEST 2017]; root of context hierarchy INFO--- Unregistering JMX-exposed beans on shutdown Result code of 0, exiting

Temporary Workaround:
I execute the shell script on a windows machine and adding a Java 8 installation in front of the current windows path before the execution of hub-detect.sh
set PATH="C:\Program Files\Java\jdk1.8.0_144\bin";%PATH%

Hub-detect lacks an invalid json parameter error

Issue template

Expected behavior

  • If the SPRING_APPLICATION_JSON environment variable does not have proper JSON then it the error message should indicate that

Actual behavior

  • If the SPRING_APPLICATION_JSON environment variable does not have proper JSON then hub-detect just complains about an empty username/password

Steps to Reproduce

  • Put invalid json into the SPRING_APPLICATION_JSON variable
  • Run hub-detect
  • Observe that the error just complains about the username/password/url not being set

Version

Project Version:

  • 4.4.2
    OS:

  • OSX

Pip scanning fails with message

Issue template

Expected behavior

  • Pip scanning completes successfully

Actual behavior

  • Pip scanning fails with this message:
Running executable >/usr/bin/python /root/blackduck/shared/pip/pip-inspector.py --projectname=toscan
2018-09-10 19:51:21 INFO  [main-Executable_Stream_Thread] --- Traceback (most recent call last):
2018-09-10 19:51:21 INFO  [main-Executable_Stream_Thread] ---   File "/root/blackduck/shared/pip/pip-inspector.py", line 30, in <module>
2018-09-10 19:51:21 INFO  [main-Executable_Stream_Thread] ---     pip_major_version = int(pip.__version__[:2])
2018-09-10 19:51:21 INFO  [main-Executable_Stream_Thread] --- ValueError: invalid literal for int() with base 10: '1.'
2018-09-10 19:51:21 INFO  [main] --- Executable finished: 1
2018-09-10 19:51:21 INFO  [main] --- ------------------------------------------------------------------------------------------------------
2018-09-10 19:51:21 INFO  [main] --- Finished extraction: FAILURE
2018-09-10 19:51:21 INFO  [main] --- Code locations found: 0
2018-09-10 19:51:21 INFO  [main] --- The Pip Inspector tree parser failed to produce output

Steps to Reproduce

  • Below is a dockerfile that will replicate it

Version

4.2.1

Language Version:
Python 2.7
Pip 1.5.4

OS:

  • Ubuntu

**Here is the docker file that will reproduce it:

FROM openjdk:8-jdk-slim

RUN apt-get update \
    && apt-get upgrade -y \
    && apt-get install -y \
    build-essential \
    ca-certificates \
    gcc \
    git \
    libpq-dev \
    make \
    python-pip \
    python2.7 \
    python2.7-dev \
    ssh \
    && apt-get autoremove \
    && apt-get clean

RUN pip install -U "setuptools==3.4.1"
RUN pip install -U "pip==1.5.4"
RUN pip install -U "Mercurial==2.9.1"
RUN pip install -U "virtualenv==1.11.4"

The bash script loses multi-word parameters

Issue template

Expected behavior

  • hub-detect.sh preserves parameters containing spaces.

Actual behavior

  • hub-detect.sh passes only the first word from parameters containing spaces.

Steps to Reproduce

  • bash hub-detect.sh ... --detect.maven.build.command="compile -s settings.xml"

Version

Project Version:

  • master

OS:

  • any

Maven error message confusion

I attempted to use the hub scanner on my development laptop against a Maven project. The scan failed to process my pom.xml and displayed the message 'Could not find a Maven wrapper or executable'. It was only after I came to Github and read the code that I worked out that the message means it couldn't locate the MVN executable as opposed to some sort of project executable generated by my Maven build! I didn't have Maven installed directly on my machine because I've been working in Eclipse, but now that I've installed Maven I can scan using the scanner.

It would have saved me some pain if the message had been a little more obvious - perhaps something like 'Could not find the Maven executable mvn, please ensure that Maven has been installed correctly.'

Nuget support on OSX needed

Issue template

Expected behavior

  • The nuget scanner does not work on OSX. We need this for Xamarin Support

Actual behavior

  • We get this build error:

[10:54:31] [Step 1/1] 2018-07-20 11:05:06 INFO [main] --- Starting extraction: NUGET - Solution
[10:54:31] [Step 1/1] 2018-07-20 11:05:06 INFO [main] --- Identifier: 20224131
[10:54:31] [Step 1/1] 2018-07-20 11:05:06 INFO [main] --- Extractor: NugetInspectorExtractor
[10:54:31] [Step 1/1] 2018-07-20 11:05:06 INFO [main] --- Context: NugetInspectorContext
[10:54:31] [Step 1/1] 2018-07-20 11:05:06 INFO [main] --- inspectorExe : /Users//blackduck/shared/IntegrationNugetInspector.2.4.0/tools/IntegrationNugetInspector.exe
[10:54:31] [Step 1/1] 2018-07-20 11:05:06 INFO [main] --- directory : /Applications/buildAgent/work/lkajsdflkajdiolsajfjsdjfasdlfjas
[10:54:31] [Step 1/1] 2018-07-20 11:05:06 INFO [main] --- ------------------------------------------------------------------------------------------------------
[10:54:31] [Step 1/1] 2018-07-20 11:05:06 INFO [main] --- Running executable >/Users//blackduck/shared/IntegrationNugetInspector.2.4.0/tools/IntegrationNugetInspector.exe --target_path=/Applications/buildAgent/work/lkajsdflkajdiolsajfjsdjfasdlfjas --output_directory=/Users//blackduck/extractions/NugetInspectorContext-20224131 --ignore_failure=false --excluded_modules= --included_modules= --packages_repo_url=https://www.nuget.org/api/v2/
[10:54:31] [Step 1/1] 2018-07-20 11:05:06 INFO [Executable Stream Thread] --- /Users//blackduck/shared/IntegrationNugetInspector.2.4.0/tools/IntegrationNugetInspector.exe: /Users//blackduck/shared/IntegrationNugetInspector.2.4.0/tools/IntegrationNugetInspector.exe: cannot execute binary file

Steps to Reproduce

  • Create a Xamarin project and scan it with hub-detect with the nuget scanner

Version

Project Version:

  • 4.0.0
    Language Version:

  • C#
    OS:

  • OSX

Nuget inspector fails with null-pointer exception

Nuget inspector fails with null-pointer exception

Expected behavior

  • Nuget scanner completes successfully

Actual behavior

  • Nuget scanner fails with a null-pointer exception

Steps to Reproduce

  • I'm trying to get a sample solution file but I'm not sure why it fails. We might have to figure out how to get the file to you all privately

Version

Project Version:

  • 4.3.2
    Language Version:

  • Nuget
    OS:

  • Windows 10 Pro

In particular I would love to learn how you can turn up logging. I tried setting: "logging.level.com.blackducksoftware.integration":"ALL" and saw no change in the log

[10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- ====================================================================================================== [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- Search results [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- ====================================================================================================== [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- C:\BuildAgent\work\37da67b48aae830a [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- APPLIES: NUGET - Solution [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- ====================================================================================================== [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- ====================================================================================================== [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- Preparation for extraction [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- ====================================================================================================== [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- C:\BuildAgent\work\37da67b48aae830a [10:50:52] [Step 1/1] 2018-10-15 08:36:33 ERROR [main] --- FAILED: NUGET - Solution - Exception occured: java.lang.NullPointerException [10:50:52] [Step 1/1] 2018-10-15 08:36:33 INFO [main] --- ======================================================================================================

Hi,

Black Duck ignoring npm dependencies

Our organization have been using BlackDuck for analyzing security and License related issues in npm packages. Recently, we have noticed an issue in blackduck scans. It often misses some dependencies while scanning an npm package. Question here is what can be the reason for ignoring a package dependency in results?

Operating Systems Produced on:
Windows 10

Loading Gradle Inspector Requires Connection to Maven Central

Loading Gradle Inspector Requires Connection to Maven Central

Expected behavior

When setting a repository URL and fixed version without wildcards for the Gradle inspector (through detect.gradle.inspector.repository.url and detect.gradle.inspector.version, no connection to Maven Central (http://repo2.maven.org) is established.

Actual behavior

Even thoughdetect.gradle.inspector.repository.url=https://my-maven-central.url/ and detect.gradle.inspector.version=0.7.0 is set, a connection to Maven Central (http://repo2.maven.org) is established.

Steps to Reproduce

$ export DETECT_LATEST_RELEASE_VERSION=4.3.1`
$ hub-detect.sh \
     --blackduck.api.token=**** \
     --blackduck.url=https://my-hub.url \
     --detect.project.name=test --detect.project.version.name=0.1 \
     --detect.gradle.inspector.repository.url=https://my-maven-central.url/ \
     --detect.gradle.inspector.version=0.7.0 

Version

hub-detect version: 4.3.1 and higher

Problem description

There might be build environments, where access to Maven Central is not possible due to corporate policy. In such cases, it should be possible to download the Gradle Inspector from a mirror repository.

This was possible in hub-detect version 4.3.0 by setting the parameters detect.gradle.inspector.repository.url and detect.gradle.inspector.version as shown above.

In more recent versions, a connection to Maven Central is established in any case, causing an exception to be thrown, which eventually fails the execution of hub detect.

I think the relevant commit is ccdac43

Possible solutions

I think there are two possible solutions:

  • Do not try to resolve the version from the metadata.xml in case it is not a range (this is the behavior from 4.3.0)
  • Use the supplied detect.gradle.inspector.repository.url to do the version resolution

Misc

Also, I think it would be great to make the hard-coded URL configurable and use an HTTPS connection in the default value.

Collect NodeJS version

You can specify the NodeJS version in the package.json file using the engine property. Could be useful to collect that also as a dependency, so we could also detect security issues for NodeJS.

Unable to run hub detect on dotnet core app (Nuget) in debian linux environment

Expected behavior

  • Hub Detect works on a dotnet core app in a Debian Linux environment

Actual behavior

  • Error during BOM Tool "preparing for extraction" step: com.blackducksoftware.integration.hub.detect.exception.DetectUserFriendlyException: Unable to find a nuget executable even though nuget applied.

Steps to Reproduce

  • We're doing this within a docker container, so the environment is clean. Here's our Dockerfile:
FROM microsoft/dotnet:2.1-sdk

RUN apt-get update && apt-get -y install default-jre

WORKDIR work

COPY . .

RUN dotnet build src/x.y.z/x.y.z.csproj
  • From our project directory (where this Dockerfile is located) we build the image:
docker build -t local-dotnetcore:latest .
  • Then to invoke hub-detect, we run the image as a container:
docker run -e BLACKDUCK_USERNAME -e BLACKDUCK_PASSWORD -e BLACKDUCK_URL local-dotnetcore:latest bash -c "./hubdetect.sh"
  • Where hubdetect.sh contains:
#!/bin/bash

set -o errexit -o nounset -o xtrace -o pipefail

bash <(curl -s https://blackducksoftware.github.io/hub-detect/hub-detect.sh) \
    --blackduck.url=${BLACKDUCK_URL} \
    --blackduck.hub.username=${BLACKDUCK_USERNAME} \
    --blackduck.password=${BLACKDUCK_PASSWORD}
  • And we get this issue when searching for BOM tools:
. . .
Preparation for extraction
. . . 
FAILED:NUGET - Solution - Exception occured: com.blackducksoftware.integration.hub.detect.exception.DetectUserFriendlyException: Unable to find a nuget executable even though nuget applied.

Version

Detect Version: 4.4.1

Language Version: netcoreapp2.1

Base Docker Image: microsoft/dotnet:2.1-sdk

OS: From inside the container:

root@9fdb6bf00626:/work# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Powershell is closing after hub-detect execution

Issue template

Expected behavior

  • Powershell shall be visible after script execution

Actual behavior

  • Powershell is closing after script execution

Steps to Reproduce

Version

Project Version:

  • Detect Version 4.1.2

Language Version:

  • EN
    OS:
  • Windows 10

Failure BOM Tool

Hi,

I'm trying to run hub-detect in my sbt project and although scans seem to be done with success the Overall Status is FAILURE_BOM_TOOL.

I see these lines being logged:

ERROR--- Sbt was unable to parse any dependencies from any resolution caches. WARN--- Unable to create an sbt project, no sbt modules were found. ERROR--- Unable to find any dependency information. ERROR--- Did not find any projects from SBT even though it applied.

Is this normal? What could be causing this issue?

Exception while running hub-detect

I tried to run the hub-detect, and it failed with a very unclear error. I know this is beta, but I was asked by the support to try it out. This is the configuration file:

detect.hub.url=***
detect.hub.timeout=120
detect.hub.username=***
detect.hub.password=****

detect.hub.auto.import.cert=

detect.hub.proxy.host=
detect.hub.proxy.port=
detect.hub.proxy.username=
detect.hub.proxy.password=

detect.source.paths=ios
detect.output.path=
detect.search.depth=
detect.cleanup.bdio.files=
detect.cleanup.bom.tool.files=
detect.bom.aggregate=
detect.bom.tool.type.override=
detect.search.depth=

detect.project.name=test
detect.project.version.name=1

detect.gradle.inspector.version=
detect.gradle.path=
detect.gradle.build.command=
detect.gradle.excluded.configurations=
detect.gradle.included.configurations=
detect.gradle.excluded.projects=
detect.gradle.included.projects=

detect.pip.project.name=
detect.pip.create.virtual.env=
detect.pip.pip3=
detect.pip.requirements.path=
detect.pip.virtualEnv.path=
detect.pip.path=
detect.python.path=

detect.maven.scope=
detect.maven.aggregate=
detect.maven.path=

detect.nuget.inspector.name=
detect.nuget.inspector.version=
detect.nuget.aggregate=
detect.nuget.ignore.failure=
detect.nuget.excluded.modules=
detect.nuget.path=

detect.godep.path=
detect.go.aggregate=

detect.docker.inspector.path=
detect.docker.inspector.version=
detect.docker.install.path=
detect.docker.sandbox.path=
detect.docker.tar=
detect.docker.image=
detect.docker.path=
detect.bash.path=

logging.level.com.blackducksoftware.integration=INFO

I am running it by using bash <(curl -s https://blackducksoftware.github.io/hub-detect/hub-detect.sh) --spring.config.location=application.properties. And this is the error:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    41  100    41    0     0    150      0 --:--:-- --:--:-- --:--:--   150
will look for release: hub-detect-0.0.4.jar
You have already downloaded the latest file, so the local file will be used.
running detect: /tmp/hub-detect-0.0.4.jar --spring.config.location=application.properties

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.2.RELEASE)

2017-06-19 16:53:57.732  INFO 39477 --- [           main] c.b.integration.hub.detect.Application   : Starting Application on OmerL-Mac with PID 39477 (/private/tmp/hub-detect-0.0.4.jar started by omerl in /Users/omerl/dev/soluto-home-app)
2017-06-19 16:53:57.739  INFO 39477 --- [           main] c.b.integration.hub.detect.Application   : No active profile set, falling back to default profiles: default
2017-06-19 16:53:57.908  INFO 39477 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@725bef66: startup date [Mon Jun 19 16:53:57 IDT 2017]; root of context hierarchy
2017-06-19 16:53:59.708  WARN 39477 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'application': Unsatisfied dependency expressed through field 'bomToolManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bomToolManager': Unsatisfied dependency expressed through field 'detectProperties'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'detectProperties': Unsatisfied dependency expressed through field 'inspectorIgnoreFailure'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'boolean'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value []
2017-06-19 16:53:59.721  INFO 39477 --- [           main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-06-19 16:53:59.758 ERROR 39477 --- [           main] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'application': Unsatisfied dependency expressed through field 'bomToolManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bomToolManager': Unsatisfied dependency expressed through field 'detectProperties'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'detectProperties': Unsatisfied dependency expressed through field 'inspectorIgnoreFailure'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'boolean'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value []
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
	at org.springframework.boot.builder.SpringApplicationBuilder$run$0.call(Unknown Source) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [groovy-all-2.4.11.jar!/:2.4.11]
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [groovy-all-2.4.11.jar!/:2.4.11]
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) [groovy-all-2.4.11.jar!/:2.4.11]
	at com.blackducksoftware.integration.hub.detect.Application.main(Application.groovy:55) [classes!/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_74]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_74]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_74]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_74]
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [hub-detect-0.0.4.jar:na]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [hub-detect-0.0.4.jar:na]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [hub-detect-0.0.4.jar:na]
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [hub-detect-0.0.4.jar:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bomToolManager': Unsatisfied dependency expressed through field 'detectProperties'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'detectProperties': Unsatisfied dependency expressed through field 'inspectorIgnoreFailure'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'boolean'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value []
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	... 29 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'detectProperties': Unsatisfied dependency expressed through field 'inspectorIgnoreFailure'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'boolean'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value []
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	... 42 common frames omitted
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'boolean'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value []
	at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:77) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:54) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1092) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	... 55 common frames omitted
Caused by: java.lang.IllegalArgumentException: Invalid boolean value []
	at org.springframework.beans.propertyeditors.CustomBooleanEditor.setAsText(CustomBooleanEditor.java:123) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:468) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:441) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:199) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:125) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:61) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	... 59 common frames omitted

How to use the exit code in Jenkins?

Hello,

I'm new to BlackDuck and I've been looking over the docs on the Confluence, but I haven't figured out how to make this work. I have a Jenkinsfile where I'm currently calling hub_detect (latest version) as follows:

hub_detect pluginOptions

This works (in order to generically succeed/fail a build), but I'd like to catch the exit code and react differently depending on which code returns, something like this:

switch(hub_detect pluginOptions) { ... }

If I do exactly what I show above, I only ever get 'null' in the switch condition. I tried wrapping the hub_detect call in sh() and adding the return status boolean but that won't work either since it's not a shell call. How can I interrogate my hub_detect call to get the exit code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.