반응형
Error
블랙덕을 이용하여 Gradle 프로젝트 Scan시 아래와 같은 에러가 발생함
2024-03-27 17:38:52 KST INFO [main] --- ======== Detect Issues ========
2024-03-27 17:38:52 KST INFO [main] ---
2024-03-27 17:38:52 KST INFO [main] --- DETECTORS:
2024-03-27 17:38:52 KST INFO [main] --- Detector Issue
2024-03-27 17:38:52 KST INFO [main] --- D:\{yourPath}\workspace\{yourProject}
2024-03-27 17:38:52 KST INFO [main] --- Not Extractable: GRADLE - Gradle Inspector
2024-03-27 17:38:52 KST INFO [main] --- No gradle executable was found.
2024-03-27 17:38:52 KST INFO [main] ---
2024-03-27 17:38:52 KST INFO [main] --- ======== Detect Result ========
2024-03-27 17:38:52 KST INFO [main] ---
2024-03-27 17:38:52 KST INFO [main] --- Black Duck Project BOM: https://blackduck.hmg-corp.io/api/projects/~~~~~~~~/components
2024-03-27 17:38:52 KST INFO [main] ---
2024-03-27 17:38:52 KST INFO [main] --- ======== Detect Status ========
2024-03-27 17:38:52 KST INFO [main] ---
2024-03-27 17:38:52 KST INFO [main] --- GIT: SUCCESS
2024-03-27 17:38:52 KST INFO [main] --- GRADLE: FAILURE
2024-03-27 17:38:52 KST INFO [main] ---
2024-03-27 17:38:52 KST INFO [main] --- Signature scan / Snippet scan on D:\{yourPath}\workspace\{yourProject}: SUCCESS
2024-03-27 17:38:52 KST INFO [main] --- Overall Status: FAILURE_DETECTOR - Detect had one or more detector failures while extracting dependencies. Check that all projects build and your environment is configured correctly.
2024-03-27 17:38:52 KST INFO [main] ---
2024-03-27 17:38:52 KST INFO [main] --- If you need help troubleshooting this problem, generate a diagnostic zip file by adding '-d' to the command line, and provide it to Synopsys Technical Support. See 'Diagnostic Mode' in the Detect documentation for more information.
2024-03-27 17:38:52 KST INFO [main] ---
2024-03-27 17:38:52 KST INFO [main] --- ===============================
2024-03-27 17:38:52 KST INFO [main] ---
2024-03-27 17:38:52 KST INFO [main] --- Detect duration: 00h 00m 40s 571ms
2024-03-27 17:38:52 KST ERROR [main] --- Exiting with code 5 - FAILURE_DETECTOR
반응형
Solution
여러가지 이유가 있겠지만 나의 경우 원인은 아래 세가지였음.
1. Scan할 프로젝트가 IDE에서 빌드 중이거나 실행 중이면 안됨.
실행 중인 프로그램을 정상종료 후 다시 Scan하면 정상적으로 실행됨
2. 해당 Gradle 프로젝트다 build가 성공적이여야 함.
단, 아래와 같이 Active Profiles가 설정 안된 상태에서 빌드되어야함.
dev, stg 등 Active Profiles에 값이 설정되야 빌드되면 블랙덕 실행시 Fail 됨.
3. Gradle 프로젝트의 경우 root에 gradlew.bat이 존재해야한다.
아래 로그를 보면
Running executable >D:\{yourPath}\workspace\{yourProject}\gradlew.bat gatherDependencies --init-script=C:\Users\Administrator\AppData\Roaming\Synopsy
window에서 BlackDuck으로 프로젝트 스캔시 gradlew.bat을 사용하기 때문에 필요함.
gitignore등 으로 인해 프로젝트에 gradlew.bat파일이 없다면 Fail이 발생함. (github에 ignore 되어있어서 bat파일이 없어서 에러 발생함)
나는 위 세가지를 수정하여 성공할 수 있었음.
2024-03-27 17:42:07 KST INFO [main] --- ======== Detect Result ========
2024-03-27 17:42:07 KST INFO [main] ---
2024-03-27 17:42:07 KST INFO [main] --- Black Duck Project BOM: https://blackduck.hmg-corp.io/api/projects/9860e0a3-d979-41ab-91b4-0002073b3bb0/versions/d79ccd56-5393-4fa5-bd97-d3daa489d491/components
2024-03-27 17:42:07 KST INFO [main] ---
2024-03-27 17:42:07 KST INFO [main] --- ======== Detect Status ========
2024-03-27 17:42:07 KST INFO [main] ---
2024-03-27 17:42:07 KST INFO [main] --- GIT: SUCCESS
2024-03-27 17:42:07 KST INFO [main] --- GRADLE: SUCCESS
2024-03-27 17:42:07 KST INFO [main] ---
2024-03-27 17:42:07 KST INFO [main] --- Signature scan / Snippet scan on D:\{yourPath}\workspace\{yourProject}: SUCCESS
2024-03-27 17:42:07 KST INFO [main] --- Overall Status: SUCCESS - Detect exited successfully.
2024-03-27 17:42:07 KST INFO [main] ---
2024-03-27 17:42:07 KST INFO [main] --- ===============================
2024-03-27 17:42:07 KST INFO [main] ---
2024-03-27 17:42:07 KST INFO [main] --- Detect duration: 00h 00m 57s 348ms
Thank you!
반응형