$ show blackducksoftware/detect
Black Duck Detect is a Java-based Software Composition Analysis (SCA) tool that scans project dependencies to identify open source components, licenses, and security vulnerabilities. It functions as an intelligent client for the Black Duck SCA platform, sending Bill of Materials (BOM) data for risk analysis. The architecture is modular with core detector framework, ecosystem-specific detectors (Maven, NPM, Gradle, etc.), configuration system, workflow orchestration, and tool integrations. Entry points include CLI scripts (detect.sh/detect.ps1) and the DetectorApplication main class. Primary data flows involve configuration parsing, ecosystem detection, dependency extraction, BDIO generation, and upload to Black Duck server. External dependencies include package managers/build tools (mvn, npm, etc.) and libraries like Gson and Apache Commons.
The LLM identified 5 files worth highlighting for reuse:
Defines a Resolver interface for locating executables in system path or via configuration, with OS-specific extension handling. Implementations like MavenResolver and NpmResolver provide pluggable executable resolution. This isolated pattern can be extracted for any application needing external tool detection.
Base class for detection outcomes with subclasses for specific failure modes (missing files, executables not found, etc.) and success. Provides rich failure context beyond boolean/exception. This self-contained pattern improves error handling in any operation with multiple failure paths.
Utility for normalizing configuration keys (case-insensitive, delimiter conversion). Handles flexible input like 'DUCKET_FEATURE' vs 'duckett.feature.flag'. This isolated, reusable component solves a common configuration problem with minimal dependencies.
Comprehensive property system with StringProperty, BooleanProperty, EnumProperty, SoftEnumProperty, and ExtendedEnumProperty. Supports parsing, validation, deprecated values, aliases, and grouping. This configurable, typesafe framework can be extracted for robust configuration in any Java application.
Simple publish-subscribe event system with generic type safety for loose coupling. Enables components to communicate via events without direct dependencies. This reusable pattern supports synchronous/asynchronous handling and can be extracted for event-driven architectures.