├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── build.gradle ├── detect-configuration ├── detect-configuration.gradle └── src │ └── main │ ├── java │ └── com │ │ └── blackducksoftware │ │ └── integration │ │ └── hub │ │ └── detect │ │ ├── BomToolDeprecationHandler.java │ │ ├── DetectInfo.java │ │ ├── DetectInfoUtility.java │ │ ├── DetectMajorVersion.java │ │ ├── DetectTool.java │ │ ├── configuration │ │ ├── ConnectionManager.java │ │ ├── DetectConfiguration.java │ │ ├── DetectConfigurationManager.java │ │ ├── DetectProperty.java │ │ ├── DetectPropertyDeprecations.java │ │ ├── DetectPropertyMap.java │ │ ├── DetectPropertySource.java │ │ ├── DetectorSearchExcludedDirectories.java │ │ └── PropertyAuthority.java │ │ ├── exception │ │ └── DetectUserFriendlyException.java │ │ ├── exitcode │ │ └── ExitCodeType.java │ │ ├── help │ │ ├── AcceptableValues.java │ │ ├── ArgumentParser.java │ │ ├── DefaultValue.java │ │ ├── DetectArgumentState.java │ │ ├── DetectArgumentStateParser.java │ │ ├── DetectDeprecation.java │ │ ├── DetectListOption.java │ │ ├── DetectOption.java │ │ ├── DetectOptionHelp.java │ │ ├── DetectOptionManager.java │ │ ├── DetectSingleOption.java │ │ ├── HelpDescription.java │ │ ├── HelpDetailed.java │ │ ├── HelpGroup.java │ │ ├── html │ │ │ ├── HelpHtmlData.java │ │ │ ├── HelpHtmlDataBuilder.java │ │ │ ├── HelpHtmlGroup.java │ │ │ ├── HelpHtmlOption.java │ │ │ └── HelpHtmlWriter.java │ │ ├── json │ │ │ ├── HelpJsonData.java │ │ │ ├── HelpJsonOption.java │ │ │ └── HelpJsonWriter.java │ │ └── print │ │ │ ├── DetectConfigurationPrinter.java │ │ │ ├── DetectInfoPrinter.java │ │ │ ├── HelpPrinter.java │ │ │ └── HelpTextWriter.java │ │ ├── interactive │ │ ├── InteractiveManager.java │ │ ├── InteractiveOption.java │ │ ├── mode │ │ │ ├── DefaultInteractiveMode.java │ │ │ └── InteractiveMode.java │ │ └── reader │ │ │ ├── ConsoleInteractiveReader.java │ │ │ ├── InteractiveReader.java │ │ │ └── ScannerInteractiveReader.java │ │ ├── property │ │ ├── PropertyConverter.java │ │ ├── PropertyMap.java │ │ ├── PropertySource.java │ │ ├── PropertyType.java │ │ └── SpringPropertySource.java │ │ ├── type │ │ ├── ExecutableType.java │ │ └── OperatingSystemType.java │ │ └── util │ │ ├── SpringValueUtils.java │ │ └── TildeInPathResolver.java │ └── resources │ └── templates │ └── helpHtml.ftl ├── detect-doctor ├── detect-doctor.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── synopsys │ │ └── detect │ │ └── doctor │ │ ├── DoctorApplication.java │ │ ├── DoctorException.java │ │ ├── RehydratedPropertySource.java │ │ ├── configuration │ │ ├── DoctorArgumentState.java │ │ ├── DoctorArgumentStateParser.java │ │ ├── DoctorConfiguration.java │ │ └── DoctorProperty.java │ │ ├── diagnosticparser │ │ ├── DetectRunInfo.java │ │ └── DiagnosticParser.java │ │ ├── executable │ │ └── DoctorExecutableRunner.java │ │ ├── extraction │ │ ├── ExtractionHandler.java │ │ ├── GradleExtractionDebugger.java │ │ └── NugetSolutionExtractionDebugger.java │ │ ├── logparser │ │ ├── DetectExtractionParser.java │ │ ├── DetectLogParseResult.java │ │ ├── DetectLogParser.java │ │ ├── DetectLogPropertyParser.java │ │ ├── DoctorStringUtils.java │ │ ├── LoggedDetectConfiguration.java │ │ ├── LoggedDetectExtraction.java │ │ ├── LoggedDetectProperty.java │ │ └── LoggedPropertyType.java │ │ └── run │ │ ├── DoctorDirectoryManager.java │ │ └── DoctorRun.java │ └── test │ └── java │ ├── ExtractionParserTest.java │ └── PropertyParserTest.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── hub-detect ├── airgap.gradle ├── artifactory-properties.gradle ├── hub-detect.gradle └── src │ ├── main │ ├── groovy │ │ └── com │ │ │ └── blackducksoftware │ │ │ └── integration │ │ │ └── hub │ │ │ └── detect │ │ │ ├── Application.java │ │ │ ├── DetectorBeanConfiguration.java │ │ │ ├── RunBeanConfiguration.java │ │ │ ├── configuration │ │ │ ├── DetectConfigurationFactory.java │ │ │ └── DetectorOptionFactory.java │ │ │ ├── detector │ │ │ ├── Detector.java │ │ │ ├── DetectorEnvironment.java │ │ │ ├── DetectorException.java │ │ │ ├── DetectorFactory.java │ │ │ ├── DetectorType.java │ │ │ ├── ExtractionId.java │ │ │ ├── bitbake │ │ │ │ ├── BitbakeDetector.java │ │ │ │ ├── BitbakeDetectorOptions.java │ │ │ │ ├── BitbakeExtractor.java │ │ │ │ ├── BitbakeListTasksParser.java │ │ │ │ └── GraphParserTransformer.java │ │ │ ├── clang │ │ │ │ ├── ApkPackageManager.java │ │ │ │ ├── ClangCompileCommandParser.java │ │ │ │ ├── ClangDetector.java │ │ │ │ ├── ClangExtractor.java │ │ │ │ ├── ClangLinuxPackageManager.java │ │ │ │ ├── CodeLocationAssembler.java │ │ │ │ ├── CompileCommand.java │ │ │ │ ├── CompileCommandJsonData.java │ │ │ │ ├── CompileCommandsJsonFile.java │ │ │ │ ├── DependenciesListFileManager.java │ │ │ │ ├── DependencyFileDetails.java │ │ │ │ ├── DpkgPackageManager.java │ │ │ │ ├── PackageDetails.java │ │ │ │ └── RpmPackageManager.java │ │ │ ├── cocoapods │ │ │ │ ├── ExternalSources.java │ │ │ │ ├── Pod.java │ │ │ │ ├── PodSource.java │ │ │ │ ├── PodfileLock.java │ │ │ │ ├── PodlockDetector.java │ │ │ │ ├── PodlockExtractor.java │ │ │ │ └── PodlockParser.java │ │ │ ├── conda │ │ │ │ ├── CondaCliDetector.java │ │ │ │ ├── CondaCliExtractor.java │ │ │ │ ├── CondaInfo.java │ │ │ │ ├── CondaListElement.java │ │ │ │ └── CondaListParser.java │ │ │ ├── cpan │ │ │ │ ├── CpanCliDetector.java │ │ │ │ ├── CpanCliExtractor.java │ │ │ │ └── CpanListParser.java │ │ │ ├── cran │ │ │ │ ├── PackRatNodeParser.java │ │ │ │ ├── PackratLockDetector.java │ │ │ │ ├── PackratLockExtractor.java │ │ │ │ └── PackratPackager.java │ │ │ ├── go │ │ │ │ ├── DepPackager.java │ │ │ │ ├── GoCliDetector.java │ │ │ │ ├── GoDepExtractor.java │ │ │ │ ├── GoInspectorManager.java │ │ │ │ ├── GoLockDetector.java │ │ │ │ ├── GoVendorDetector.java │ │ │ │ ├── GoVendorExtractor.java │ │ │ │ ├── GoVendorJsonData.java │ │ │ │ ├── GoVendorJsonPackageData.java │ │ │ │ ├── GoVendorJsonParser.java │ │ │ │ ├── GoVndrDetector.java │ │ │ │ ├── GoVndrExtractor.java │ │ │ │ ├── GopkgLock.java │ │ │ │ ├── GopkgLockParser.java │ │ │ │ ├── Project.java │ │ │ │ ├── SolveMeta.java │ │ │ │ └── VndrParser.java │ │ │ ├── gradle │ │ │ │ ├── GradleExecutableFinder.java │ │ │ │ ├── GradleInspectorDetector.java │ │ │ │ ├── GradleInspectorExtractor.java │ │ │ │ ├── GradleInspectorManager.java │ │ │ │ ├── GradleReportConfigurationParser.java │ │ │ │ ├── GradleReportLine.java │ │ │ │ ├── GradleReportParser.java │ │ │ │ └── GradleScriptCreator.java │ │ │ ├── hex │ │ │ │ ├── Rebar3TreeParser.java │ │ │ │ ├── RebarDetector.java │ │ │ │ ├── RebarExtractor.java │ │ │ │ └── RebarParseResult.java │ │ │ ├── maven │ │ │ │ ├── MavenCliExtractor.java │ │ │ │ ├── MavenCodeLocationPackager.java │ │ │ │ ├── MavenExecutableFinder.java │ │ │ │ ├── MavenParseResult.java │ │ │ │ ├── MavenPomDetector.java │ │ │ │ ├── MavenPomWrapperDetector.java │ │ │ │ └── ScopedDependency.java │ │ │ ├── npm │ │ │ │ ├── NpmCliDetector.java │ │ │ │ ├── NpmCliExtractor.java │ │ │ │ ├── NpmCliParser.java │ │ │ │ ├── NpmDependencyConverter.java │ │ │ │ ├── NpmExecutableFinder.java │ │ │ │ ├── NpmLockfileExtractor.java │ │ │ │ ├── NpmLockfileParser.java │ │ │ │ ├── NpmPackageLockDetector.java │ │ │ │ ├── NpmParseResult.java │ │ │ │ ├── NpmShrinkwrapDetector.java │ │ │ │ └── model │ │ │ │ │ ├── NpmDependency.java │ │ │ │ │ ├── NpmRequires.java │ │ │ │ │ ├── PackageJson.java │ │ │ │ │ ├── PackageLock.java │ │ │ │ │ └── PackageLockDependency.java │ │ │ ├── nuget │ │ │ │ ├── NugetDependencyNodeBuilder.java │ │ │ │ ├── NugetInspectorExtractor.java │ │ │ │ ├── NugetInspectorManager.java │ │ │ │ ├── NugetInspectorPackager.java │ │ │ │ ├── NugetParseResult.java │ │ │ │ ├── NugetProjectDetector.java │ │ │ │ ├── NugetSolutionDetector.java │ │ │ │ ├── inspector │ │ │ │ │ ├── DotNetCoreNugetInspector.java │ │ │ │ │ ├── ExeNugetInspector.java │ │ │ │ │ └── NugetInspector.java │ │ │ │ └── model │ │ │ │ │ ├── NugetContainer.java │ │ │ │ │ ├── NugetContainerType.java │ │ │ │ │ ├── NugetInspection.java │ │ │ │ │ ├── NugetPackageId.java │ │ │ │ │ └── NugetPackageSet.java │ │ │ ├── packagist │ │ │ │ ├── ComposerLockDetector.java │ │ │ │ ├── ComposerLockExtractor.java │ │ │ │ ├── PackagistPackage.java │ │ │ │ ├── PackagistParseResult.java │ │ │ │ └── PackagistParser.java │ │ │ ├── pear │ │ │ │ ├── PearCliDetector.java │ │ │ │ ├── PearCliExtractor.java │ │ │ │ ├── PearParseResult.java │ │ │ │ └── PearParser.java │ │ │ ├── pip │ │ │ │ ├── PipInspectorDetector.java │ │ │ │ ├── PipInspectorExtractor.java │ │ │ │ ├── PipInspectorManager.java │ │ │ │ ├── PipInspectorTreeParser.java │ │ │ │ ├── PipParseResult.java │ │ │ │ ├── PipenvDetector.java │ │ │ │ ├── PipenvExtractor.java │ │ │ │ ├── PipenvGraphParser.java │ │ │ │ └── PythonExecutableFinder.java │ │ │ ├── rubygems │ │ │ │ ├── GemlockDetector.java │ │ │ │ ├── GemlockExtractor.java │ │ │ │ └── GemlockParser.java │ │ │ ├── sbt │ │ │ │ ├── SbtAggregate.java │ │ │ │ ├── SbtCaller.java │ │ │ │ ├── SbtDependencyModule.java │ │ │ │ ├── SbtDependencyResolver.java │ │ │ │ ├── SbtGraph.java │ │ │ │ ├── SbtModule.java │ │ │ │ ├── SbtModuleAggregator.java │ │ │ │ ├── SbtPackager.java │ │ │ │ ├── SbtProject.java │ │ │ │ ├── SbtReport.java │ │ │ │ ├── SbtReportParser.java │ │ │ │ ├── SbtResolutionCacheDetector.java │ │ │ │ ├── SbtResolutionCacheExtractor.java │ │ │ │ └── SbtRevision.java │ │ │ └── yarn │ │ │ │ ├── BaseYarnParser.java │ │ │ │ ├── YarnListParser.java │ │ │ │ ├── YarnLockDetector.java │ │ │ │ ├── YarnLockExtractor.java │ │ │ │ └── YarnLockParser.java │ │ │ ├── lifecycle │ │ │ ├── DetectContext.java │ │ │ ├── boot │ │ │ │ ├── BootFactory.java │ │ │ │ ├── BootManager.java │ │ │ │ ├── BootResult.java │ │ │ │ ├── ConnectivityChecker.java │ │ │ │ └── ConnectivityResult.java │ │ │ ├── run │ │ │ │ ├── RunManager.java │ │ │ │ ├── RunOptions.java │ │ │ │ └── RunResult.java │ │ │ └── shutdown │ │ │ │ ├── ExitCodeManager.java │ │ │ │ ├── ExitCodeRequest.java │ │ │ │ ├── ExitCodeUtility.java │ │ │ │ └── ShutdownManager.java │ │ │ ├── tool │ │ │ ├── SimpleToolDetector.java │ │ │ ├── ToolRunner.java │ │ │ ├── bazel │ │ │ │ ├── BazelCodeLocationBuilder.java │ │ │ │ ├── BazelDetector.java │ │ │ │ ├── BazelExecutableFinder.java │ │ │ │ ├── BazelExternalId.java │ │ │ │ ├── BazelExternalIdExtractionFullRule.java │ │ │ │ ├── BazelExternalIdExtractionFullRuleJsonProcessor.java │ │ │ │ ├── BazelExternalIdExtractionSimpleRule.java │ │ │ │ ├── BazelExternalIdExtractionSimpleRules.java │ │ │ │ ├── BazelExternalIdGenerator.java │ │ │ │ ├── BazelExtractor.java │ │ │ │ ├── BazelQueryXmlOutputParser.java │ │ │ │ ├── BazelVariableSubstitutor.java │ │ │ │ ├── RuleConverter.java │ │ │ │ ├── SearchReplacePattern.java │ │ │ │ └── XPathParser.java │ │ │ ├── binaryscanner │ │ │ │ ├── BinaryScanToolResult.java │ │ │ │ └── BlackDuckBinaryScannerTool.java │ │ │ ├── detector │ │ │ │ ├── DetectorTool.java │ │ │ │ └── DetectorToolResult.java │ │ │ ├── docker │ │ │ │ ├── DockerDetector.java │ │ │ │ ├── DockerExtractor.java │ │ │ │ ├── DockerInspectorInfo.java │ │ │ │ ├── DockerInspectorManager.java │ │ │ │ ├── DockerOptions.java │ │ │ │ └── DockerProperties.java │ │ │ ├── polaris │ │ │ │ ├── PolarisEnvironmentCheck.java │ │ │ │ └── PolarisTool.java │ │ │ └── signaturescanner │ │ │ │ ├── BlackDuckSignatureScanner.java │ │ │ │ ├── BlackDuckSignatureScannerOptions.java │ │ │ │ ├── BlackDuckSignatureScannerTool.java │ │ │ │ ├── OfflineBlackDuckSignatureScanner.java │ │ │ │ ├── OnlineBlackDuckSignatureScanner.java │ │ │ │ ├── ScanBatchRunnerFactory.java │ │ │ │ ├── SignatureScanPath.java │ │ │ │ └── SignatureScannerToolResult.java │ │ │ ├── util │ │ │ ├── DependencyHistory.java │ │ │ ├── DetectEnumUtil.java │ │ │ ├── DetectZipUtil.java │ │ │ ├── EnumUtilExtension.java │ │ │ ├── XmlUtil.java │ │ │ ├── executable │ │ │ │ ├── CacheableExecutableFinder.java │ │ │ │ ├── Executable.java │ │ │ │ ├── ExecutableArgumentBuilder.java │ │ │ │ ├── ExecutableFinder.java │ │ │ │ ├── ExecutableOutput.java │ │ │ │ ├── ExecutableRunner.java │ │ │ │ ├── ExecutableRunnerException.java │ │ │ │ └── ExecutableStreamThread.java │ │ │ └── filter │ │ │ │ ├── DetectFilter.java │ │ │ │ ├── DetectNameFilter.java │ │ │ │ └── DetectOverrideableFilter.java │ │ │ └── workflow │ │ │ ├── ArtifactResolver.java │ │ │ ├── ArtifactoryConstants.java │ │ │ ├── ConnectivityManager.java │ │ │ ├── DetectRun.java │ │ │ ├── DetectToolFilter.java │ │ │ ├── bdio │ │ │ ├── AggregateBdioCreator.java │ │ │ ├── BdioManager.java │ │ │ ├── BdioOptions.java │ │ │ ├── BdioResult.java │ │ │ ├── CodeLocationBdioCreator.java │ │ │ └── DetectBdioWriter.java │ │ │ ├── codelocation │ │ │ ├── BdioCodeLocation.java │ │ │ ├── BdioCodeLocationCreator.java │ │ │ ├── BdioCodeLocationResult.java │ │ │ ├── CodeLocationNameGenerator.java │ │ │ ├── CodeLocationNameManager.java │ │ │ ├── CodeLocationNameType.java │ │ │ ├── DetectCodeLocation.java │ │ │ ├── DetectCodeLocationType.java │ │ │ └── FileNameUtils.java │ │ │ ├── detector │ │ │ ├── DetectorManager.java │ │ │ └── RequiredDetectorChecker.java │ │ │ ├── diagnostic │ │ │ ├── DiagnosticLogger.java │ │ │ ├── DiagnosticManager.java │ │ │ ├── DiagnosticReportHandler.java │ │ │ ├── DiagnosticSystem.java │ │ │ ├── DiagnosticZipCreator.java │ │ │ └── RelevantFileTracker.java │ │ │ ├── event │ │ │ ├── Event.java │ │ │ ├── EventListener.java │ │ │ ├── EventSystem.java │ │ │ └── EventType.java │ │ │ ├── extraction │ │ │ ├── Extraction.java │ │ │ ├── ExtractionManager.java │ │ │ ├── ExtractionResult.java │ │ │ ├── PreparationManager.java │ │ │ └── PreparationResult.java │ │ │ ├── file │ │ │ ├── AirGapManager.java │ │ │ ├── AirGapOptions.java │ │ │ ├── DetectFileFinder.java │ │ │ ├── DetectFileUtils.java │ │ │ ├── DirectoryManager.java │ │ │ └── DirectoryOptions.java │ │ │ ├── hub │ │ │ ├── BlackduckPostActions.java │ │ │ ├── BlackduckReportOptions.java │ │ │ ├── CodeLocationWaitData.java │ │ │ ├── DetectBdioUploadService.java │ │ │ ├── DetectCodeLocationUnmapService.java │ │ │ ├── DetectProjectMappingService.java │ │ │ ├── DetectProjectMappingView.java │ │ │ ├── DetectProjectService.java │ │ │ ├── DetectProjectServiceOptions.java │ │ │ ├── ExclusionPatternCreator.java │ │ │ ├── PolicyCheckOptions.java │ │ │ └── PolicyChecker.java │ │ │ ├── phonehome │ │ │ ├── OnlinePhoneHomeManager.java │ │ │ └── PhoneHomeManager.java │ │ │ ├── profiling │ │ │ ├── BomToolProfiler.java │ │ │ ├── BomToolTimekeeper.java │ │ │ ├── DetectorTime.java │ │ │ └── DetectorTimings.java │ │ │ ├── project │ │ │ ├── DetectProject.java │ │ │ ├── DetectToolProjectInfo.java │ │ │ ├── DetectorEvaluationNameVersionDecider.java │ │ │ ├── DetectorNameVersionDecider.java │ │ │ ├── DetectorProjectInfo.java │ │ │ ├── ProjectNameVersionDecider.java │ │ │ ├── ProjectNameVersionOptions.java │ │ │ └── decisions │ │ │ │ ├── ArbitraryNameVersionDecision.java │ │ │ │ ├── NameVersionDecision.java │ │ │ │ ├── PreferredDetectorDecision.java │ │ │ │ ├── PreferredDetectorNotFoundDecision.java │ │ │ │ ├── TooManyPreferredDetectorTypesFoundDecision.java │ │ │ │ ├── UniqueDetectorDecision.java │ │ │ │ └── UniqueDetectorNotFoundDecision.java │ │ │ ├── report │ │ │ ├── CodeLocationDependencyCounter.java │ │ │ ├── CodeLocationReporter.java │ │ │ ├── ConfigurationReporter.java │ │ │ ├── DetailedSearchSummarizer.java │ │ │ ├── DetailedSearchSummaryBomToolData.java │ │ │ ├── DetailedSearchSummaryData.java │ │ │ ├── DetailedSearchSummaryReporter.java │ │ │ ├── DetectConfigurationReporter.java │ │ │ ├── DetectorEvaluationSummarizer.java │ │ │ ├── ErrorSummarizer.java │ │ │ ├── ErrorSummaryBomToolError.java │ │ │ ├── ErrorSummaryData.java │ │ │ ├── ErrorSummaryReporter.java │ │ │ ├── ExtractionSummarizer.java │ │ │ ├── ExtractionSummaryData.java │ │ │ ├── ExtractionSummaryReporter.java │ │ │ ├── OverviewSummarizer.java │ │ │ ├── OverviewSummaryData.java │ │ │ ├── OverviewSummaryReporter.java │ │ │ ├── PreparationSummarizer.java │ │ │ ├── PreparationSummaryData.java │ │ │ ├── PreparationSummaryReporter.java │ │ │ ├── ProfilingReporter.java │ │ │ ├── ReportManager.java │ │ │ ├── SearchSummarizer.java │ │ │ ├── SearchSummaryData.java │ │ │ ├── SearchSummaryReporter.java │ │ │ ├── util │ │ │ │ ├── ObjectPrinter.java │ │ │ │ ├── ReportConstants.java │ │ │ │ └── ReporterUtils.java │ │ │ └── writer │ │ │ │ ├── DebugLogReportWriter.java │ │ │ │ ├── FileReportWriter.java │ │ │ │ ├── InfoLogReportWriter.java │ │ │ │ ├── LogReportWriter.java │ │ │ │ ├── ReportWriter.java │ │ │ │ └── TraceLogReportWriter.java │ │ │ ├── search │ │ │ ├── DetectorExclusionSearchFilter.java │ │ │ ├── DetectorFinder.java │ │ │ ├── DetectorFinderOptions.java │ │ │ ├── DetectorSearchFilter.java │ │ │ ├── SearchManager.java │ │ │ ├── SearchOptions.java │ │ │ ├── SearchResult.java │ │ │ ├── SearchResultBomToolFailed.java │ │ │ ├── SearchResultSuccess.java │ │ │ ├── result │ │ │ │ ├── DetectorEvaluation.java │ │ │ │ ├── DetectorResult.java │ │ │ │ ├── ExceptionDetectorResult.java │ │ │ │ ├── ExcludedDetectorResult.java │ │ │ │ ├── ExecutableNotFoundDetectorResult.java │ │ │ │ ├── FailedDetectorResult.java │ │ │ │ ├── FileNotFoundDetectorResult.java │ │ │ │ ├── FilesNotFoundDetectorResult.java │ │ │ │ ├── ForcedNestedPassedDetectorResult.java │ │ │ │ ├── InspectorNotFoundDetectorResult.java │ │ │ │ ├── MaxDepthExceededDetectorResult.java │ │ │ │ ├── NotNestableDetectorResult.java │ │ │ │ ├── NotSelfNestableDetectorResult.java │ │ │ │ ├── NpmRunInstallDetectorResult.java │ │ │ │ ├── PassedDetectorResult.java │ │ │ │ ├── PropertyInsufficientDetectorResult.java │ │ │ │ ├── WrongOperatingSystemResult.java │ │ │ │ └── YieldedDetectorResult.java │ │ │ └── rules │ │ │ │ ├── DetectorSearchEvaluator.java │ │ │ │ ├── DetectorSearchProvider.java │ │ │ │ ├── DetectorSearchRule.java │ │ │ │ ├── DetectorSearchRuleBuilder.java │ │ │ │ ├── DetectorSearchRuleSet.java │ │ │ │ ├── DetectorSearchRuleSetBuilder.java │ │ │ │ └── DetectorYieldBuilder.java │ │ │ └── status │ │ │ ├── BinaryScanStatus.java │ │ │ ├── DetectStatusLogger.java │ │ │ ├── DetectStatusManager.java │ │ │ ├── DetectorStatus.java │ │ │ ├── DockerStatus.java │ │ │ ├── SignatureScanStatus.java │ │ │ ├── Status.java │ │ │ └── StatusType.java │ └── resources │ │ ├── application-diagnostic.properties │ │ ├── application.properties │ │ ├── banner.txt │ │ ├── buildInfo.json │ │ ├── hub-detect-4-sh │ │ ├── hub-detect-ps │ │ ├── hub-detect-sh │ │ ├── init-script-gradle.ftl │ │ └── pip-inspector.py │ └── test │ ├── groovy │ └── com │ │ └── blackducksoftware │ │ └── integration │ │ └── hub │ │ └── detect │ │ ├── AllAndNoneExcludedIncludedFilterTest.java │ │ ├── DetectorFactoryTest.java │ │ ├── TestNpmBdio.java │ │ ├── detector │ │ ├── DetectorTypeTest.java │ │ ├── bitbake │ │ │ ├── BitbakeListTasksParserTest.java │ │ │ └── GraphParserTransformerTest.java │ │ ├── clang │ │ │ ├── ApkPackageManagerTest.java │ │ │ ├── ClangCompileCommandParserTest.java │ │ │ ├── ClangExtractorTest.java │ │ │ ├── DpkgPackageManagerTest.java │ │ │ └── RpmPackageManagerTest.java │ │ ├── cocoapods │ │ │ └── CocoapodsPackagerTest.java │ │ ├── conda │ │ │ └── CondaListParserTest.java │ │ ├── cpan │ │ │ └── CpanListParserTest.java │ │ ├── go │ │ │ ├── GoVendorExtractorTest.java │ │ │ ├── GoVendorJsonParserTest.java │ │ │ ├── GopkgLockParserTest.java │ │ │ └── VndrParserTest.java │ │ ├── gradle │ │ │ ├── GradleReportLineTest.java │ │ │ └── GradleReportParserTest.java │ │ ├── hex │ │ │ └── RebarParserTest.java │ │ ├── maven │ │ │ └── MavenCodeLocationPackagerTest.java │ │ ├── npm │ │ │ ├── NpmLockfileParserTest.java │ │ │ └── NpmOutputParserTest.java │ │ ├── nuget │ │ │ ├── NugetInspectorPackagerPerfTest.java │ │ │ └── NugetInspectorPackagerTest.java │ │ ├── packagist │ │ │ └── PackagistTest.java │ │ ├── pear │ │ │ └── PearDependencyTest.java │ │ ├── pip │ │ │ ├── PipEnvTreeParserTest.java │ │ │ └── PipInspectorTreeParserTest.java │ │ ├── rubygems │ │ │ ├── GemlockNodeParserTest.java │ │ │ └── RubygemsNodePackagerTest.java │ │ └── yarn │ │ │ ├── YarnListParserTest.java │ │ │ └── YarnLockParserTest.java │ │ ├── help │ │ └── ArgumentStateParserTests.java │ │ ├── testutils │ │ ├── DependencyGraphAssertions.java │ │ ├── DependencyGraphResourceTestUtil.java │ │ └── TestUtil.java │ │ ├── tool │ │ └── bazel │ │ │ ├── BazelCodeLocationBuilderTest.java │ │ │ ├── BazelExternalIdExtractionFullRuleJsonProcessorTest.java │ │ │ ├── BazelExternalIdExtractionFullRuleTest.java │ │ │ ├── BazelExternalIdGeneratorTest.java │ │ │ ├── BazelQueryXmlOutputParserTest.java │ │ │ ├── BazelVariableSubstitutorTest.java │ │ │ └── XPathParserTest.java │ │ ├── util │ │ ├── DetectFileFinderTest.java │ │ ├── DirectoryManagerTest.java │ │ └── TildeInPathResolverTest.java │ │ └── workflow │ │ ├── codelocation │ │ └── CodeLocationNameGeneratorTest.java │ │ └── project │ │ └── ProjectNameDeciderTests.java │ └── resources │ ├── bazel │ ├── multiLevel │ │ ├── README.md │ │ ├── WORKSPACE │ │ ├── java │ │ │ ├── BUILD │ │ │ ├── README.md │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── myproject │ │ │ │ │ │ └── Greeter.java │ │ │ │ └── resources │ │ │ │ │ └── greeting.txt │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── myproject │ │ │ │ ├── TestCustomGreeting.java │ │ │ │ └── TestHello.java │ │ └── python │ │ │ ├── BUILD │ │ │ ├── README.md │ │ │ ├── bin.py │ │ │ ├── fibonacci │ │ │ ├── BUILD │ │ │ └── fib.py │ │ │ ├── lib.py │ │ │ └── test.py │ ├── sample1.xml │ └── sample2.xml │ ├── bitbake │ ├── listtasks_output.txt │ └── recipe-depends.dot │ ├── clang │ ├── compile_commands.json │ ├── compile_commands_args.json │ └── source │ │ ├── build │ │ ├── compile_commands.json │ │ └── compile_commands_usesArguments.json │ │ └── myinclude.h │ ├── cocoapods │ ├── complexExpected.json │ ├── complexExpected_graph.json │ ├── complexPodfile.lock │ ├── externalSourcesFile.lock │ ├── simpleExpected.json │ ├── simpleExpected_graph.json │ └── simplePodfile.lock │ ├── conda │ ├── condaInfo.json │ ├── condaListLarge.json │ ├── condaListLargeExpected.json │ ├── condaListLargeExpected_graph.json │ ├── condaListSmall.json │ ├── condaListSmallExpected.json │ └── condaListSmallExpected_graph.json │ ├── cpan │ ├── cpanList.txt │ ├── expectedDependencyNodes.json │ ├── expectedDependencyNodes_graph.json │ └── showDeps.txt │ ├── docker │ └── ubuntu_var_lib_dpkg_ubuntu_latest_bdio.jsonld │ ├── fileFinder │ ├── sub1 │ │ └── subsub │ │ │ ├── test1.txt │ │ │ └── test2.txt │ ├── sub2 │ │ └── subsub │ │ │ └── test3.txt │ └── test0.txt │ ├── go │ ├── Go_Godeps.json │ ├── Go_GodepsParserExpected.json │ ├── Go_GodepsParserExpected_graph.json │ ├── Go_GopkgExpected.json │ ├── Go_GopkgExpected_graph.json │ ├── Go_VndrExpected.json │ ├── Go_VndrExpected_graph.json │ ├── Gopkg.lock │ ├── vendor.conf │ └── vendor │ │ └── vendor.json │ ├── gradle │ ├── dependencyGraph-expected.json │ ├── dependencyGraph.txt │ ├── gradle-missing-relationships.txt │ ├── gradle_implementations_dependencyGraph.txt │ ├── maven-metadata.xml │ ├── parse-tests │ │ └── complex_dependencyGraph.txt │ ├── rootProjectMetadata.txt │ └── spring-framework │ │ ├── spring_aop_dependencyGraph.txt │ │ ├── spring_aspects_dependencyGraph.txt │ │ ├── spring_beans_dependencyGraph.txt │ │ ├── spring_build_src_dependencyGraph.txt │ │ ├── spring_context_dependencyGraph.txt │ │ ├── spring_context_indexer_dependencyGraph.txt │ │ ├── spring_context_support_dependencyGraph.txt │ │ ├── spring_core_dependencyGraph.txt │ │ ├── spring_dependencyGraph.txt │ │ ├── spring_expression_dependencyGraph.txt │ │ ├── spring_framework_bom_dependencyGraph.txt │ │ ├── spring_instrument_dependencyGraph.txt │ │ ├── spring_jcl_dependencyGraph.txt │ │ ├── spring_jdbc_dependencyGraph.txt │ │ ├── spring_jms_dependencyGraph.txt │ │ ├── spring_messaging_dependencyGraph.txt │ │ ├── spring_orm_dependencyGraph.txt │ │ ├── spring_oxm_dependencyGraph.txt │ │ ├── spring_test_dependencyGraph.txt │ │ ├── spring_tx_dependencyGraph.txt │ │ ├── spring_web_dependencyGraph.txt │ │ ├── spring_webflux_dependencyGraph.txt │ │ ├── spring_webmvc_dependencyGraph.txt │ │ └── spring_websocket_dependencyGraph.txt │ ├── hex │ └── dependencyTree.txt │ ├── hub-artifactory-reduced-tree.txt │ ├── maven │ ├── compileScopeUnderTestScope.txt │ ├── compileScopeUnderTestScopeCompileScope.json │ ├── compileScopeUnderTestScopeNoScope.json │ ├── hubTeamCityCodeLocation.json │ ├── hubTeamCityExcludedCodeLocation.json │ ├── hubTeamCityIncludedCodeLocation.json │ ├── hubTeamcityOutput.txt │ ├── hubTeamcityOutputWithDependencyUnpack.txt │ ├── hubTeamcityOutputWithStrangePrefixesFoundFromCustomer.txt │ ├── mavenSampleOutput.txt │ ├── sonarStashCodeLocation.json │ ├── sonarStashCorruptCodeLocation.json │ ├── sonarStashCorruptOutput.txt │ ├── sonarStashOutput.txt │ ├── webgoat-container-pom-dependency-tree-output.txt │ └── webgoatCodeLocation.json │ ├── npm │ ├── npm-shrinkwrap.json │ ├── npmParseOutput.json │ ├── npmParseOutput_graph.json │ ├── package-lock.json │ ├── packageLockExpected_graph.json │ ├── packman_proj_dependencies.json │ └── shrinkwrapExpected_graph.json │ ├── nuget │ ├── LDService.Dashboard_Output.json │ ├── LDService.Dashboard_Output_0_graph.json │ ├── LDService.Dashboard_inspection.json │ ├── LDService_Output.json │ ├── LDService_Output_0_graph.json │ ├── LDService_Output_10_graph.json │ ├── LDService_Output_11_graph.json │ ├── LDService_Output_12_graph.json │ ├── LDService_Output_1_graph.json │ ├── LDService_Output_2_graph.json │ ├── LDService_Output_3_graph.json │ ├── LDService_Output_4_graph.json │ ├── LDService_Output_5_graph.json │ ├── LDService_Output_6_graph.json │ ├── LDService_Output_7_graph.json │ ├── LDService_Output_8_graph.json │ ├── LDService_Output_9_graph.json │ ├── LDService_inspection.json │ ├── dwCheckApi_inspection.json │ ├── dwCheckApi_inspection_martin.json │ ├── nuget_v2_response.xml │ └── nuget_v3_response.json │ ├── packagist │ ├── PackagistTestDependencyNode.txt │ ├── PackagistTestDependencyNode_graph.json │ ├── composer.json │ └── composer.lock │ ├── pear │ ├── dependencies-list.txt │ ├── dependency-node-list.txt │ ├── dependency-node-list_graph.json │ ├── installed-packages.txt │ └── package.xml │ ├── pip │ ├── expected.json │ └── expected_graph.json │ ├── rubygems │ ├── Gemfile-rails.lock │ ├── Gemfile.lock │ ├── Gemfile_equals_version.lock │ ├── Gemfile_missing_versions.lock │ ├── expectedPackager.json │ ├── expectedPackager_graph.json │ ├── expectedParser.json │ ├── expectedParser_graph.json │ ├── expectedSmallParser.json │ ├── expectedSmallParser_graph.json │ └── small_gemfile_lock │ └── yarn │ ├── expected.json │ ├── expected_graph.json │ ├── list_expected_graph.json │ ├── list_expected_graph_2.json │ ├── yarn.list.res.txt │ ├── yarn.list.txt │ └── yarn.lock └── settings.gradle /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Issue template 2 | ## Expected behavior 3 | * 4 | ## Actual behavior 5 | * 6 | ## Steps to Reproduce 7 | * 8 | * 9 | * 10 | ## Version 11 | **Project Version:** 12 | 13 | * 14 | **Language Version:** 15 | 16 | * 17 | **OS:** 18 | 19 | * -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Please include a short description of the changes and problems fixed. 4 | 5 | # Github Issues 6 | 7 | (Optional) Please link to any applicable github issues. 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # operating system 2 | .DS_Store 3 | 4 | # ide 5 | .settings/ 6 | .classpath 7 | .project 8 | bin/ 9 | .idea 10 | *.iml 11 | out/ 12 | 13 | # build tool 14 | .gradle/ 15 | build/ 16 | 17 | version.txt 18 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | ### 2 | ### generated by script 3 | ### 4 | 5 | language: java 6 | sudo: false 7 | install: true 8 | 9 | addons: 10 | sonarcloud: 11 | token: 12 | secure: "tGi86abq+UgIfB/StpMh75QIzL7hysmgOB8A5TOWjdYwV87MMu25hUuSPlMcJFWUbl96tJ/nAd6BAw/vm5zgb4ldaQOy/Dr17rltrUfbH5xONJLXLuF4REOeyUhHScmEpthdocwtGZI36WRYtOj+F5jpPU2Qg/RDgypPVKsFyFhmc6KhS6i/ZswH3McLg3zReIqouykz9rLFy+UXL2wd/Qj5nJC0nc2GfGHLBBSkH8awHi1wwlCwKDxF+w8mAXcEbXbt7gY1CrbBTTovD4g7y7ZOFXqcLrBWlZ/of8S3fNBkys5tFTp9/219WubcKy7+n7d9zQDITiK1Z4X+jGfjQw7L0CESNoKeESzi44fkyOR5DQAhPoQi/aFiQff4TwQxuqz22a0oCjOC7EEyYkPCrzcJWuPUDEs420B2Ddg9Sr4WwiAOWx6j0rpqxt72Phbf7kYd/Da3RRDFptwsWy3B1M811Z/IJErxBt5wDqc3gRimebYD21EGYUgn3KAZhsLVrS21xzPu6d0FoOF/Z7se5BPJExcK1rglRBDA2tD399LlrFW++KJ5ZJU6+kgbHxy6Z7ZQze4JxDz+2zeVT7wvuHWyssqy70P6w94q5lTJ65jm3Ywg4iZzNj2VWzHeCKElamXcwbu8nlLcVpFDaXA/GGWfjiIDJZsRCDYzgwc2rIs=" 13 | 14 | jdk: 15 | - oraclejdk8 16 | 17 | notifications: 18 | email: 19 | recipients: 20 | - bdsoss@blackducksoftware.com 21 | 22 | script: 23 | - "./gradlew clean build jacocoTestReport coveralls sonarqube" 24 | 25 | after_success: 26 | - bash <(curl -s https://copilot.blackducksoftware.com/ci/travis/scripts/upload) 27 | 28 | cache: 29 | directories: 30 | - "$HOME/.m2/repository" 31 | - "$HOME/.sonar/cache" 32 | - "$HOME/.gradle" 33 | - ".gradle" 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Overview ## 2 | Project renamed, ARCHIVED and End Of Lifed, please see: https://github.com/blackducksoftware/synopsys-detect 3 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '2.0.3.RELEASE' 4 | } 5 | repositories { 6 | jcenter() 7 | mavenCentral() 8 | maven { url 'https://plugins.gradle.org/m2/' } 9 | } 10 | 11 | dependencies { 12 | classpath 'com.blackducksoftware.integration:common-gradle-plugin:0.0.+' 13 | classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" 14 | } 15 | } 16 | 17 | apply plugin: 'java' 18 | 19 | version = '5.3.0-SNAPSHOT' 20 | String parentVersion = project.version 21 | 22 | allprojects { 23 | task dependencies(type: DependencyReportTask) {} 24 | } 25 | 26 | configure(subprojects) { project -> 27 | group = 'com.blackducksoftware.integration' 28 | version = parentVersion 29 | 30 | apply plugin: 'com.blackducksoftware.integration.solution' 31 | apply plugin: 'groovy' 32 | apply plugin: 'maven-publish' 33 | apply plugin: 'io.spring.dependency-management' 34 | 35 | license { 36 | header rootProject.file('LICENSE') 37 | } 38 | 39 | dependencyManagement { 40 | imports { 41 | mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") 42 | } 43 | } 44 | 45 | dependencies { 46 | implementation 'com.blackducksoftware.integration:blackduck-common:41.2.0' 47 | implementation 'com.paypal.digraph:digraph-parser:1.0' 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /detect-configuration/detect-configuration.gradle: -------------------------------------------------------------------------------- 1 | final def versionFile = new File("${projectDir}/src/main/resources/version.txt") 2 | versionFile.delete() 3 | versionFile << version 4 | 5 | dependencies { 6 | implementation 'org.freemarker:freemarker:2.3.26-incubating' 7 | implementation 'org.springframework:spring-core' 8 | implementation 'org.springframework:spring-context' 9 | } 10 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/BomToolDeprecationHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect; 25 | 26 | //Remove when support for BOM TOOLS is dropped. 27 | public class BomToolDeprecationHandler { 28 | //DOCKER is not a DETECTOR, migrate that 29 | //New Tools Property: DETECT_BOM_TOOLS_DISABLED, DETECT_BLACKDUCK_SIGNATURE_SCANNER_DISABLED & DETECT_HUB_SIGNATURE_SCANNER_DISABLED 30 | } 31 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/DetectMajorVersion.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect; 25 | 26 | public enum DetectMajorVersion { 27 | ONE(1), 28 | TWO(2), 29 | THREE(3), 30 | FOUR(4), 31 | FIVE(5), 32 | SIX(6), 33 | SEVEN(7); 34 | 35 | private int value = 0; 36 | 37 | DetectMajorVersion(final int value) { 38 | this.value = value; 39 | } 40 | 41 | public int getIntValue() { 42 | return value; 43 | } 44 | 45 | public String getDisplayValue() { 46 | return Integer.toString(value) + ".0.0"; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/DetectTool.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect; 25 | 26 | public enum DetectTool { 27 | DETECTOR, 28 | SIGNATURE_SCAN, 29 | BINARY_SCAN, 30 | POLARIS, 31 | DOCKER, 32 | BAZEL; 33 | } 34 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/AcceptableValues.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target(ElementType.FIELD) 33 | public @interface AcceptableValues { 34 | String[] value() default {}; 35 | 36 | boolean strict() default false; 37 | 38 | boolean caseSensitive() default false; 39 | 40 | boolean isCommaSeparatedList() default false; 41 | } 42 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/DefaultValue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target(ElementType.FIELD) 33 | public @interface DefaultValue { 34 | String value() default ""; 35 | } 36 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/DetectDeprecation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | import com.blackducksoftware.integration.hub.detect.DetectMajorVersion; 32 | 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target(ElementType.FIELD) 35 | public @interface DetectDeprecation { 36 | String description() default ""; 37 | 38 | DetectMajorVersion failInVersion() default DetectMajorVersion.ONE; 39 | 40 | DetectMajorVersion removeInVersion() default DetectMajorVersion.ONE; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/HelpDescription.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target(ElementType.FIELD) 33 | public @interface HelpDescription { 34 | String value() default ""; 35 | } 36 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/HelpDetailed.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target(ElementType.FIELD) 33 | public @interface HelpDetailed { 34 | String value() default ""; 35 | } 36 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/HelpGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help; 25 | 26 | import java.lang.annotation.ElementType; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target(ElementType.FIELD) 33 | public @interface HelpGroup { 34 | String primary() default ""; 35 | 36 | String[] additional() default {}; 37 | } 38 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/html/HelpHtmlData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help.html; 25 | 26 | import java.util.List; 27 | 28 | public class HelpHtmlData { 29 | public List groups; 30 | 31 | public HelpHtmlData(List groups) { 32 | this.groups = groups; 33 | } 34 | 35 | public List getGroups() { 36 | return groups; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/html/HelpHtmlGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help.html; 25 | 26 | import java.util.List; 27 | 28 | public class HelpHtmlGroup { 29 | public String groupName; 30 | public List options; 31 | 32 | public String getGroupName() { 33 | return groupName; 34 | } 35 | 36 | public List getOptions() { 37 | return options; 38 | } 39 | } -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/json/HelpJsonData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help.json; 25 | 26 | import java.util.ArrayList; 27 | import java.util.List; 28 | 29 | public class HelpJsonData { 30 | public List options = new ArrayList<>(); 31 | } 32 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/print/DetectConfigurationPrinter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help.print; 25 | 26 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/help/print/DetectInfoPrinter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.help.print; 25 | 26 | import java.io.PrintStream; 27 | 28 | import com.blackducksoftware.integration.hub.detect.DetectInfo; 29 | 30 | public class DetectInfoPrinter { 31 | public void printInfo(final PrintStream printStream, final DetectInfo detectInfo) { 32 | printStream.println(""); 33 | printStream.println("Detect Version: " + detectInfo.getDetectVersion()); 34 | printStream.println(""); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/interactive/reader/ConsoleInteractiveReader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.interactive.reader; 25 | 26 | import java.io.Console; 27 | 28 | public class ConsoleInteractiveReader implements InteractiveReader { 29 | private final Console console; 30 | 31 | public ConsoleInteractiveReader(final Console console) { 32 | this.console = console; 33 | } 34 | 35 | @Override 36 | public String readLine() { 37 | return console.readLine(); 38 | } 39 | 40 | @Override 41 | public String readPassword() { 42 | return new String(console.readPassword()); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/interactive/reader/InteractiveReader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.interactive.reader; 25 | 26 | public interface InteractiveReader { 27 | public String readLine(); 28 | 29 | public String readPassword(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/property/PropertySource.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.property; 25 | 26 | import java.util.Set; 27 | 28 | public interface PropertySource { 29 | public boolean containsProperty(final String key); 30 | 31 | public String getProperty(final String key, final String defaultValue); 32 | 33 | public String getProperty(final String key); 34 | 35 | public Set getPropertyKeys(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/property/PropertyType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.property; 25 | 26 | public enum PropertyType { 27 | BOOLEAN("Boolean"), 28 | STRING("String"), 29 | STRING_ARRAY("String[]"), 30 | INTEGER("Integer"), 31 | LONG("Long"); 32 | 33 | private final String displayName; 34 | 35 | PropertyType(final String displayName) { 36 | this.displayName = displayName; 37 | } 38 | 39 | public String getDisplayName() { 40 | return displayName; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/type/OperatingSystemType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.type; 25 | 26 | public enum OperatingSystemType { 27 | LINUX, 28 | MAC, 29 | WINDOWS; 30 | } 31 | -------------------------------------------------------------------------------- /detect-configuration/src/main/java/com/blackducksoftware/integration/hub/detect/util/SpringValueUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * detect-configuration 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.util; 25 | 26 | public class SpringValueUtils { 27 | public static String springKeyFromValueAnnotation(String value) { 28 | if (value.contains("${")) { 29 | value = value.substring(2); 30 | } 31 | if (value.endsWith("}")) { 32 | value = value.substring(0, value.length() - 1); 33 | } 34 | if (value.contains(":")) { 35 | value = value.split(":")[0]; 36 | } 37 | return value; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /detect-doctor/detect-doctor.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | test { 4 | testLogging { 5 | exceptionFormat = 'full' 6 | } 7 | } 8 | 9 | dependencies { 10 | implementation project(":hub-detect") 11 | implementation project(":detect-configuration") 12 | 13 | implementation 'org.springframework.boot:spring-boot-starter' 14 | 15 | testImplementation 'org.mockito:mockito-core:1.+' 16 | } 17 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/DoctorException.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor; 2 | 3 | public class DoctorException extends Exception { 4 | 5 | public DoctorException(final String s) { 6 | super(s); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/RehydratedPropertySource.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor; 2 | 3 | import java.util.Map; 4 | import java.util.Set; 5 | 6 | import com.blackducksoftware.integration.hub.detect.property.PropertySource; 7 | 8 | public class RehydratedPropertySource implements PropertySource { 9 | 10 | private final Map values; 11 | 12 | public RehydratedPropertySource(Map values) { 13 | this.values = values; 14 | } 15 | 16 | @Override 17 | public boolean containsProperty(final String key) { 18 | return values.containsKey(key); 19 | } 20 | 21 | @Override 22 | public String getProperty(final String key, final String defaultValue) { 23 | if (values.containsKey(key)) { 24 | return values.get(key); 25 | } else { 26 | return defaultValue; 27 | } 28 | } 29 | 30 | @Override 31 | public String getProperty(final String key) { 32 | return values.get(key); 33 | } 34 | 35 | @Override 36 | public Set getPropertyKeys() { 37 | return values.keySet(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/configuration/DoctorArgumentState.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.configuration; 2 | 3 | public class DoctorArgumentState { 4 | private final boolean isExtraction; 5 | 6 | public DoctorArgumentState(final boolean isExtraction) { 7 | this.isExtraction = isExtraction; 8 | } 9 | 10 | public boolean getIsExtraction() { 11 | return isExtraction; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/configuration/DoctorArgumentStateParser.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.configuration; 2 | 3 | import com.blackducksoftware.integration.hub.detect.help.ArgumentParser; 4 | 5 | public class DoctorArgumentStateParser { 6 | 7 | public DoctorArgumentState parseArgs(final String[] args) { 8 | return parseArgs(new ArgumentParser(args)); 9 | } 10 | 11 | public DoctorArgumentState parseArgs(final ArgumentParser parser) { 12 | final boolean isExtraction = parser.isArgumentPresent("-e", "--extraction"); 13 | 14 | return new DoctorArgumentState(isExtraction); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/configuration/DoctorProperty.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.configuration; 2 | 3 | import com.blackducksoftware.integration.hub.detect.property.PropertyType; 4 | 5 | public enum DoctorProperty { 6 | DETECT_DIAGNOSTIC_FILE("doctor.detect.diagnostic.file", PropertyType.STRING, ""), 7 | 8 | DETECT_LOG_FILE("doctor.detect.log.file", PropertyType.STRING, ""), 9 | DETECT_EXTRACTION_ID("doctor.detect.extraction.id", PropertyType.STRING, ""), 10 | DETECT_OUTPUT_FOLDER("doctor.detect.output.folder", PropertyType.STRING, ""); 11 | 12 | private final String propertyName; 13 | private final PropertyType propertyType; 14 | private final String defaultValue; 15 | 16 | DoctorProperty(final String propertyName, final PropertyType propertyType, final String defaultValue) { 17 | this.propertyName = propertyName; 18 | this.propertyType = propertyType; 19 | this.defaultValue = defaultValue; 20 | } 21 | 22 | public String getPropertyName() { 23 | return propertyName; 24 | } 25 | 26 | public PropertyType getPropertyType() { 27 | return propertyType; 28 | } 29 | 30 | public String getDefaultValue() { 31 | return defaultValue; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/diagnosticparser/DetectRunInfo.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.diagnosticparser; 2 | 3 | import java.io.File; 4 | 5 | public class DetectRunInfo { 6 | 7 | private File extractionsFolder; 8 | private File logFile; 9 | 10 | public DetectRunInfo(final File logFile, File extractionsFolder) { 11 | this.extractionsFolder = extractionsFolder; 12 | this.logFile = logFile; 13 | } 14 | 15 | public File getLogFile() { 16 | return logFile; 17 | } 18 | 19 | public File getExtractionsFolder() { 20 | return extractionsFolder; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/executable/DoctorExecutableRunner.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.executable; 2 | 3 | import java.util.function.Consumer; 4 | 5 | import com.blackducksoftware.integration.hub.detect.util.executable.Executable; 6 | import com.blackducksoftware.integration.hub.detect.util.executable.ExecutableOutput; 7 | import com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunner; 8 | import com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunnerException; 9 | 10 | public class DoctorExecutableRunner extends ExecutableRunner { 11 | @Override 12 | public ExecutableOutput runExecutable(final Executable executable, final Consumer standardLoggingMethod, final Consumer traceLoggingMethod) throws ExecutableRunnerException { 13 | return new ExecutableOutput(0, "", ""); 14 | } 15 | } -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/extraction/ExtractionHandler.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.extraction; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | import com.blackducksoftware.integration.hub.detect.configuration.DetectConfiguration; 7 | import com.blackducksoftware.integration.hub.detect.detector.DetectorException; 8 | import com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunnerException; 9 | import com.synopsys.detect.doctor.diagnosticparser.DetectRunInfo; 10 | import com.synopsys.detect.doctor.logparser.LoggedDetectExtraction; 11 | 12 | public class ExtractionHandler { 13 | private final Logger logger = LoggerFactory.getLogger(this.getClass()); 14 | 15 | public void processExtraction(LoggedDetectExtraction extraction, DetectRunInfo detectRunInfo, DetectConfiguration detectConfiguration) throws DetectorException, ExecutableRunnerException { 16 | if (extraction.bomToolDescription.equals("NUGET - Solution")) { 17 | logger.info("OOOO Snap, I know how to handle this."); 18 | NugetSolutionExtractionDebugger debugger = new NugetSolutionExtractionDebugger(); 19 | debugger.debug(extraction, detectRunInfo, detectConfiguration); 20 | } else if (extraction.bomToolDescription.equals("GRADLE - Gradle Inspector")) { 21 | logger.info("OOOO Snap, I know how to handle this."); 22 | GradleExtractionDebugger debugger = new GradleExtractionDebugger(); 23 | debugger.debug(extraction, detectRunInfo, detectConfiguration); 24 | } else { 25 | throw new DetectorException("Don't know what to do with this extraction, sorry brah."); 26 | } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/logparser/DetectLogParseResult.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.logparser; 2 | 3 | public class DetectLogParseResult { 4 | public boolean success = false; 5 | public LoggedDetectConfiguration loggedConfiguration; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/logparser/DoctorStringUtils.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.logparser; 2 | 3 | public class DoctorStringUtils { 4 | public static String substringAfter(String original, String target){ 5 | return original.substring(original.indexOf(target) + target.length()); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/logparser/LoggedDetectConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.logparser; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class LoggedDetectConfiguration { 7 | public String detectVersion; 8 | public List loggedPropertyList = new ArrayList<>(); 9 | public List extractions = new ArrayList<>(); 10 | } 11 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/logparser/LoggedDetectExtraction.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.logparser; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | public class LoggedDetectExtraction { 9 | public String extractionIdentifier; 10 | public String bomToolDescription; 11 | public String bomToolGroup; 12 | public String bomToolName; 13 | public Map parameters = new HashMap<>(); 14 | 15 | public String resultDescription; 16 | public String codeLocationDescription; 17 | 18 | public List rawHeader = new ArrayList<>(); 19 | public List rawBody = new ArrayList<>(); 20 | public List rawFooter = new ArrayList<>(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/logparser/LoggedDetectProperty.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.logparser; 2 | 3 | public class LoggedDetectProperty { 4 | public String key; 5 | public String value; 6 | public String notes; 7 | public LoggedPropertyType type; 8 | } -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/logparser/LoggedPropertyType.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.logparser; 2 | 3 | public enum LoggedPropertyType { 4 | DEFAULT, 5 | INTERACTIVE, 6 | LATEST, 7 | CALCULATED, 8 | OVERRIDE, 9 | COPIED 10 | } -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/run/DoctorDirectoryManager.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.run; 2 | 3 | import java.io.File; 4 | 5 | public class DoctorDirectoryManager { 6 | 7 | public File outputDirectory; 8 | public File doctorDirectory; 9 | public File runDirectory; 10 | public File cacheDirectory; 11 | 12 | public DoctorDirectoryManager(DoctorRun doctorRun) { 13 | File userHome = new File(System.getProperty("user.home")); 14 | outputDirectory = new File(userHome, "blackduck"); 15 | doctorDirectory = new File(outputDirectory, "doctor"); 16 | File runsDirectory = new File(doctorDirectory, "runs"); 17 | runDirectory = new File(runsDirectory, doctorRun.getRunId()); 18 | 19 | } 20 | 21 | public File getDiagnosticOutputDirectory() { 22 | File diagnosticDirectory = new File(runDirectory, "diagnostic"); 23 | diagnosticDirectory.mkdirs(); 24 | return diagnosticDirectory; 25 | } 26 | 27 | public File getDiagnosticCacheDirectory() { 28 | File diagnosticDirectory = new File(doctorDirectory, "diagnostic-cache"); 29 | diagnosticDirectory.mkdirs(); 30 | return diagnosticDirectory; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /detect-doctor/src/main/java/com/synopsys/detect/doctor/run/DoctorRun.java: -------------------------------------------------------------------------------- 1 | package com.synopsys.detect.doctor.run; 2 | 3 | import java.time.Instant; 4 | import java.time.ZoneOffset; 5 | import java.time.format.DateTimeFormatter; 6 | 7 | public class DoctorRun { 8 | private final String id; 9 | 10 | public static DoctorRun createDefault() { 11 | return new DoctorRun(DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm-ss-SSS").withZone(ZoneOffset.UTC).format(Instant.now().atZone(ZoneOffset.UTC))); 12 | } 13 | 14 | public DoctorRun(String id) { 15 | this.id = id; 16 | } 17 | 18 | public String getRunId() { 19 | return this.id; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /detect-doctor/src/test/java/ExtractionParserTest.java: -------------------------------------------------------------------------------- 1 | import java.util.Arrays; 2 | import java.util.List; 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | import com.synopsys.detect.doctor.logparser.DetectExtractionParser; 8 | import com.synopsys.detect.doctor.logparser.LoggedDetectExtraction; 9 | 10 | public class ExtractionParserTest { 11 | 12 | @Test 13 | public void testHeaderParsing() { 14 | List lines = Arrays.asList("2018-08-21 10:51:48 INFO [main] --- Starting extraction: GRADLE - Gradle Inspector", 15 | "2018-08-21 10:51:48 INFO [main] --- Identifier: 1", 16 | "2018-08-21 10:51:48 INFO [main] --- gradleExe : D:\\BlackDuck\\ScanTarget\\Pilot_AVMSmartPhoneApplication\\gradlew.bat"); 17 | 18 | DetectExtractionParser parser = new DetectExtractionParser(); 19 | LoggedDetectExtraction extraction = new LoggedDetectExtraction(); 20 | 21 | for(String line : lines){ 22 | parser.parseExtractionHeader(extraction, line); 23 | } 24 | 25 | Assert.assertEquals("GRADLE - Gradle Inspector", extraction.bomToolDescription); 26 | Assert.assertEquals("Gradle Inspector", extraction.bomToolName); 27 | Assert.assertEquals("GRADLE", extraction.bomToolGroup); 28 | 29 | Assert.assertEquals("1", extraction.extractionIdentifier); 30 | 31 | Assert.assertEquals(1, extraction.parameters.size()); 32 | Assert.assertEquals("D:\\BlackDuck\\ScanTarget\\Pilot_AVMSmartPhoneApplication\\gradlew.bat", extraction.parameters.get("gradleExe")); 33 | 34 | Assert.assertEquals(3, extraction.rawHeader.size()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /detect-doctor/src/test/java/PropertyParserTest.java: -------------------------------------------------------------------------------- 1 | import org.junit.Assert; 2 | import org.junit.Test; 3 | 4 | import com.synopsys.detect.doctor.logparser.DetectLogPropertyParser; 5 | import com.synopsys.detect.doctor.logparser.LoggedDetectProperty; 6 | import com.synopsys.detect.doctor.logparser.LoggedPropertyType; 7 | 8 | public class PropertyParserTest { 9 | 10 | @Test 11 | public void defaultPropertyType() { 12 | propertyTest("blackduck.hub.offline.mode = true", "blackduck.hub.offline.mode", "true", null, LoggedPropertyType.DEFAULT); 13 | } 14 | 15 | @Test 16 | public void calculatedPropertyType() { 17 | propertyTest("detect.bdio.output.path = C:\\Users\\admin\\blackduck\\bdio [calculated]", "detect.bdio.output.path", "C:\\Users\\admin\\blackduck\\bdio", "calculated", LoggedPropertyType.CALCULATED); 18 | } 19 | 20 | @Test 21 | public void overridePropertyType() { 22 | propertyTest("detect.bom.tool.search.exclusion = node_modules,debug,bin,build,.git,.gradle,node_modules,out,packages,target [node_modules,debug]", "detect.bom.tool.search.exclusion", "node_modules,debug,bin,build,.git,.gradle,node_modules,out,packages,target", "node_modules,debug", LoggedPropertyType.OVERRIDE); 23 | } 24 | 25 | private void propertyTest(String line, String key, String value, String notes, LoggedPropertyType type) { 26 | DetectLogPropertyParser parser = new DetectLogPropertyParser(); 27 | 28 | LoggedDetectProperty property = parser.parseProperty(line); 29 | 30 | Assert.assertEquals(key, property.key); 31 | Assert.assertEquals(value, property.value); 32 | Assert.assertEquals(notes, property.notes); 33 | Assert.assertEquals(type, property.type); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/hub-detect/dc528aa57240fc849f19a19d666564176a6b9679/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/ExtractionId.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector; 25 | 26 | public class ExtractionId { 27 | private final String id; 28 | private final String extractionType; 29 | 30 | public ExtractionId(final DetectorType detectorType, final String id) { 31 | extractionType = detectorType.toString(); 32 | this.id = id; 33 | } 34 | 35 | public ExtractionId(final String extractionType, final String id) { 36 | this.id = id; 37 | this.extractionType = extractionType; 38 | } 39 | 40 | public String toUniqueString() { 41 | return extractionType + "-" + id; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/bitbake/BitbakeDetectorOptions.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.bitbake; 25 | 26 | public class BitbakeDetectorOptions { 27 | private String buildEnvName; 28 | private String[] packageNames; 29 | 30 | public BitbakeDetectorOptions(final String buildEnvName, final String[] packageNames) { 31 | this.buildEnvName = buildEnvName; 32 | this.packageNames = packageNames; 33 | } 34 | 35 | public String getBuildEnvName() { 36 | return buildEnvName; 37 | } 38 | 39 | public String[] getPackageNames() { 40 | return packageNames; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/clang/CompileCommandJsonData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.clang; 25 | 26 | import com.synopsys.integration.util.Stringable; 27 | 28 | // Loaded from json via Gson 29 | public class CompileCommandJsonData extends Stringable { 30 | public String directory; 31 | public String command; 32 | public String[] arguments; 33 | public String file; 34 | } 35 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/clang/DependencyFileDetails.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.clang; 25 | 26 | import java.io.File; 27 | 28 | public class DependencyFileDetails { 29 | private final boolean inBuildDir; 30 | private final File file; 31 | 32 | public DependencyFileDetails(final boolean inBuildDir, final File file) { 33 | this.inBuildDir = inBuildDir; 34 | this.file = file; 35 | } 36 | 37 | public boolean isInBuildDir() { 38 | return inBuildDir; 39 | } 40 | 41 | public File getFile() { 42 | return file; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/cocoapods/ExternalSources.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.cocoapods; 25 | 26 | import java.util.ArrayList; 27 | import java.util.List; 28 | 29 | import com.fasterxml.jackson.annotation.JsonAnySetter; 30 | 31 | public class ExternalSources { 32 | public List sources = new ArrayList<>(); 33 | 34 | @JsonAnySetter 35 | public void setDynamicProperty(final String name, final PodSource podSource) { 36 | podSource.name = name; 37 | sources.add(podSource); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/cocoapods/PodSource.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.cocoapods; 25 | 26 | import com.fasterxml.jackson.annotation.JsonIgnore; 27 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 28 | import com.fasterxml.jackson.annotation.JsonProperty; 29 | 30 | @JsonIgnoreProperties(ignoreUnknown = true) 31 | public class PodSource { 32 | @JsonIgnore 33 | public String name; 34 | 35 | @JsonProperty(":git") 36 | public String git; 37 | 38 | @JsonProperty(":path") 39 | public String path; 40 | } 41 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/cocoapods/PodfileLock.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.cocoapods; 25 | 26 | import java.util.List; 27 | 28 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 29 | import com.fasterxml.jackson.annotation.JsonProperty; 30 | 31 | @JsonIgnoreProperties(ignoreUnknown = true) 32 | public class PodfileLock { 33 | @JsonProperty("PODS") 34 | public List pods; 35 | 36 | @JsonProperty("DEPENDENCIES") 37 | public List dependencies; 38 | 39 | @JsonProperty("EXTERNAL SOURCES") 40 | public ExternalSources externalSources; 41 | } 42 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/conda/CondaInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.conda; 25 | 26 | import com.google.gson.annotations.SerializedName; 27 | 28 | public class CondaInfo { 29 | @SerializedName("platform") 30 | String platform; 31 | } 32 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/conda/CondaListElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.conda; 25 | 26 | import com.google.gson.annotations.SerializedName; 27 | 28 | public class CondaListElement { 29 | @SerializedName("name") 30 | String name; 31 | 32 | @SerializedName("version") 33 | String version; 34 | 35 | @SerializedName("build_string") 36 | String buildString; 37 | } 38 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/maven/MavenParseResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.maven; 25 | 26 | import com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocation; 27 | 28 | public class MavenParseResult { 29 | public String projectName; 30 | public String projectVersion; 31 | public DetectCodeLocation codeLocation; 32 | 33 | public MavenParseResult(final String projectName, final String projectVersion, final DetectCodeLocation codeLocation) { 34 | this.projectName = projectName; 35 | this.projectVersion = projectVersion; 36 | this.codeLocation = codeLocation; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/npm/NpmParseResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.npm; 25 | 26 | import com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocation; 27 | 28 | public class NpmParseResult { 29 | public String projectName; 30 | public String projectVersion; 31 | public DetectCodeLocation codeLocation; 32 | 33 | public NpmParseResult(final String projectName, final String projectVersion, final DetectCodeLocation codeLocation) { 34 | this.projectName = projectName; 35 | this.projectVersion = projectVersion; 36 | this.codeLocation = codeLocation; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/npm/model/NpmRequires.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.npm.model; 25 | 26 | public class NpmRequires { 27 | private final String name; 28 | private final String fuzzyVersion; 29 | 30 | public NpmRequires(final String name, final String fuzzyVersion) { 31 | this.name = name; 32 | this.fuzzyVersion = fuzzyVersion; 33 | } 34 | 35 | public String getName() { 36 | return name; 37 | } 38 | 39 | public String getFuzzyVersion() { 40 | return fuzzyVersion; 41 | } 42 | } -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/npm/model/PackageJson.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.npm.model; 25 | 26 | import java.util.HashMap; 27 | import java.util.Map; 28 | 29 | public class PackageJson { 30 | public Map dependencies = new HashMap<>(); 31 | public Map devDependencies = new HashMap<>(); 32 | } 33 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/npm/model/PackageLock.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.npm.model; 25 | 26 | import java.util.Map; 27 | 28 | import com.google.gson.annotations.SerializedName; 29 | 30 | public class PackageLock { 31 | @SerializedName("name") 32 | public String name; 33 | 34 | @SerializedName("version") 35 | public String version; 36 | 37 | @SerializedName("dependencies") 38 | public Map dependencies; 39 | } 40 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/npm/model/PackageLockDependency.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.npm.model; 25 | 26 | import java.util.Map; 27 | 28 | import com.google.gson.annotations.SerializedName; 29 | 30 | public class PackageLockDependency { 31 | @SerializedName("version") 32 | public String version; 33 | 34 | @SerializedName("dev") 35 | public Boolean dev; 36 | 37 | @SerializedName("requires") 38 | public Map requires; 39 | 40 | @SerializedName("dependencies") 41 | public Map dependencies; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/nuget/inspector/NugetInspector.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.nuget.inspector; 25 | 26 | import java.io.File; 27 | import java.util.List; 28 | 29 | import com.blackducksoftware.integration.hub.detect.util.executable.ExecutableOutput; 30 | import com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunnerException; 31 | 32 | public interface NugetInspector { 33 | 34 | ExecutableOutput execute(File workingDirectory, List arguments) throws ExecutableRunnerException; 35 | 36 | } -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/nuget/model/NugetContainerType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.nuget.model; 25 | 26 | import com.google.gson.annotations.SerializedName; 27 | 28 | import groovy.transform.TypeChecked; 29 | 30 | @TypeChecked 31 | public enum NugetContainerType { 32 | @SerializedName("Solution") 33 | SOLUTION, 34 | @SerializedName("Project") 35 | PROJECT 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/pear/PearParseResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.pear; 25 | 26 | import com.synopsys.integration.bdio.graph.DependencyGraph; 27 | 28 | public class PearParseResult { 29 | public String name; 30 | public String version; 31 | public DependencyGraph dependencyGraph; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/sbt/SbtAggregate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.sbt; 25 | 26 | import com.synopsys.integration.util.Stringable; 27 | 28 | public class SbtAggregate extends Stringable { 29 | public String name; 30 | public String org; 31 | public String version; 32 | 33 | public SbtAggregate(final String name, final String org, final String version) { 34 | this.name = name; 35 | this.org = org; 36 | this.version = version; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/sbt/SbtGraph.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.sbt; 25 | 26 | import com.synopsys.integration.bdio.graph.DependencyGraph; 27 | 28 | public class SbtGraph { 29 | public String sourcePath; 30 | public DependencyGraph graph; 31 | 32 | public SbtGraph(final DependencyGraph graph, final String sourcePath) { 33 | this.sourcePath = sourcePath; 34 | this.graph = graph; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/sbt/SbtProject.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.sbt; 25 | 26 | import java.util.List; 27 | 28 | import com.blackducksoftware.integration.hub.detect.detector.DetectorType; 29 | import com.synopsys.integration.bdio.model.externalid.ExternalId; 30 | 31 | public class SbtProject { 32 | public String projectName; 33 | public String projectVersion; 34 | public ExternalId projectExternalId; 35 | public DetectorType bomToolType; 36 | public List modules; 37 | } 38 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/sbt/SbtRevision.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.sbt; 25 | 26 | import java.util.List; 27 | 28 | public class SbtRevision { 29 | private final String name; 30 | private final List callers; 31 | 32 | public SbtRevision(final String name, final List callers) { 33 | this.name = name; 34 | this.callers = callers; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public List getCallers() { 42 | return callers; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/yarn/BaseYarnParser.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.detector.yarn; 25 | 26 | public abstract class BaseYarnParser { 27 | protected int getLineLevel(final String line) { 28 | int level = 0; 29 | String tmpLine = line; 30 | while (tmpLine.startsWith(" ")) { 31 | tmpLine = tmpLine.replaceFirst(" ", ""); 32 | level++; 33 | } 34 | 35 | return level; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/tool/bazel/BazelExternalIdExtractionSimpleRules.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.tool.bazel; 25 | 26 | import java.util.ArrayList; 27 | import java.util.Collection; 28 | import java.util.List; 29 | 30 | public class BazelExternalIdExtractionSimpleRules { 31 | private final List rules; 32 | 33 | public BazelExternalIdExtractionSimpleRules(final String bazelTarget) { 34 | rules = new ArrayList<>(); 35 | rules.add(new BazelExternalIdExtractionSimpleRule("@.*:jar", "maven_jar", "artifact", ":")); 36 | } 37 | 38 | public Collection getRules() { 39 | return rules; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/tool/bazel/SearchReplacePattern.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.tool.bazel; 25 | 26 | public class SearchReplacePattern { 27 | private final String searchRegex; 28 | private final String replacementString; 29 | 30 | public SearchReplacePattern(final String searchRegex, final String replacementString) { 31 | this.searchRegex = searchRegex; 32 | this.replacementString = replacementString; 33 | } 34 | 35 | public String getSearchRegex() { 36 | return searchRegex; 37 | } 38 | 39 | public String getReplacementString() { 40 | return replacementString; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/tool/signaturescanner/SignatureScanPath.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.tool.signaturescanner; 25 | 26 | import java.util.HashSet; 27 | import java.util.Set; 28 | 29 | public class SignatureScanPath { 30 | public String targetPath; 31 | public Set exclusions = new HashSet<>(); 32 | } 33 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/util/DetectEnumUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.util; 25 | 26 | import java.util.Optional; 27 | 28 | public class DetectEnumUtil { 29 | public static > Optional getValueOf(Class enumType, String name) { 30 | try { 31 | return Optional.of(Enum.valueOf(enumType, name)); 32 | } catch (IllegalArgumentException ex) { 33 | return Optional.empty(); 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/util/executable/ExecutableRunnerException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.util.executable; 25 | 26 | public class ExecutableRunnerException extends Exception { 27 | private static final long serialVersionUID = -4117278710469900787L; 28 | 29 | ExecutableRunnerException(final Throwable innerException) { 30 | super(innerException); 31 | } 32 | 33 | ExecutableRunnerException(final String exceptionOutput) { 34 | super(exceptionOutput); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/util/filter/DetectFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.util.filter; 25 | 26 | public interface DetectFilter { 27 | boolean shouldInclude(String itemName); 28 | } 29 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/util/filter/DetectNameFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.util.filter; 25 | 26 | import com.synopsys.integration.util.ExcludedIncludedFilter; 27 | 28 | public class DetectNameFilter extends ExcludedIncludedFilter implements DetectFilter { 29 | 30 | /** 31 | * Provide a comma-separated list of names to exclude and/or a comma-separated list of names to include. Exclusion rules always win. 32 | * @param toExclude 33 | * @param toInclude 34 | */ 35 | public DetectNameFilter(final String toExclude, final String toInclude) { 36 | super(toExclude, toInclude); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/DetectRun.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow; 25 | 26 | import java.time.Instant; 27 | import java.time.ZoneOffset; 28 | import java.time.format.DateTimeFormatter; 29 | 30 | public class DetectRun { 31 | private final String id; 32 | public static DetectRun createDefault() { 33 | return new DetectRun(DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm-ss-SSS").withZone(ZoneOffset.UTC).format(Instant.now().atZone(ZoneOffset.UTC))); 34 | } 35 | public DetectRun(String id){ 36 | this.id = id; 37 | } 38 | public String getRunId() { 39 | return this.id; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/bdio/BdioOptions.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.bdio; 25 | 26 | public class BdioOptions { 27 | private final String bdioAggregateName; 28 | 29 | public BdioOptions(final String bdioAggregateName) { 30 | this.bdioAggregateName = bdioAggregateName; 31 | } 32 | 33 | public String getBdioAggregateName() { 34 | return bdioAggregateName; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/codelocation/BdioCodeLocation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.codelocation; 25 | 26 | public class BdioCodeLocation { 27 | public String codeLocationName; 28 | public String bdioName; 29 | public DetectCodeLocation codeLocation; 30 | 31 | public BdioCodeLocation(final DetectCodeLocation codeLocation, final String codeLocationName, final String bdioName) { 32 | this.codeLocation = codeLocation; 33 | this.codeLocationName = codeLocationName; 34 | this.bdioName = bdioName; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/codelocation/CodeLocationNameType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.codelocation; 25 | 26 | public enum CodeLocationNameType { 27 | SCAN, 28 | BOM, 29 | DOCKER; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/codelocation/DetectCodeLocationType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.codelocation; 25 | 26 | public enum DetectCodeLocationType { 27 | BAZEL, 28 | BITBAKE, 29 | COCOAPODS, 30 | CONDA, 31 | CPAN, 32 | CRAN, 33 | DOCKER, 34 | GO_DEP, 35 | GO_VNDR, 36 | GO_VENDOR, 37 | GRADLE, 38 | HEX, 39 | MAVEN, 40 | NPM, 41 | NUGET, 42 | PACKAGIST, 43 | PEAR, 44 | PIP, 45 | RUBYGEMS, 46 | SBT, 47 | YARN, 48 | CLANG; 49 | } 50 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/event/EventListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.event; 25 | 26 | public interface EventListener { 27 | void eventOccured(T event); 28 | } 29 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/event/EventType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.event; 25 | 26 | public class EventType { 27 | 28 | public EventType(Class clazz) { 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/hub/DetectProjectMappingView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.hub; 25 | 26 | import com.synopsys.integration.blackduck.api.core.BlackDuckView; 27 | 28 | // TODO: There will eventually be a namespace field 29 | public class DetectProjectMappingView extends BlackDuckView { 30 | private String applicationId; 31 | 32 | public String getApplicationId() { 33 | return applicationId; 34 | } 35 | 36 | public void setApplicationId(final String applicationId) { 37 | this.applicationId = applicationId; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/profiling/DetectorTime.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.profiling; 25 | 26 | import com.blackducksoftware.integration.hub.detect.detector.Detector; 27 | 28 | public class DetectorTime { 29 | private final long ms; 30 | private final Detector detector; 31 | 32 | public DetectorTime(final Detector detector, final long ms) { 33 | this.ms = ms; 34 | this.detector = detector; 35 | } 36 | 37 | public long getMs() { 38 | return ms; 39 | } 40 | 41 | public Detector getDetector() { 42 | return detector; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/project/decisions/NameVersionDecision.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.project.decisions; 25 | 26 | import java.util.Optional; 27 | 28 | import org.slf4j.Logger; 29 | 30 | import com.synopsys.integration.util.NameVersion; 31 | 32 | public abstract class NameVersionDecision { 33 | public abstract void printDescription(final Logger logger); 34 | 35 | public Optional getChosenNameVersion() { 36 | return Optional.empty(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/project/decisions/UniqueDetectorNotFoundDecision.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.project.decisions; 25 | 26 | import org.slf4j.Logger; 27 | 28 | public class UniqueDetectorNotFoundDecision extends NameVersionDecision { 29 | @Override 30 | public void printDescription(final Logger logger) { 31 | logger.info("No unique detector was found. Project info could not be found in a detector."); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/report/DetailedSearchSummaryBomToolData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.report; 25 | 26 | import com.blackducksoftware.integration.hub.detect.detector.Detector; 27 | 28 | public class DetailedSearchSummaryBomToolData { 29 | private final Detector detector; 30 | private final String reason; 31 | 32 | public DetailedSearchSummaryBomToolData(final Detector detector, final String reason) { 33 | this.detector = detector; 34 | this.reason = reason; 35 | } 36 | 37 | public Detector getDetector() { 38 | return detector; 39 | } 40 | 41 | public String getReason() { 42 | return reason; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/report/ErrorSummaryBomToolError.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.report; 25 | 26 | public class ErrorSummaryBomToolError { 27 | private final String bomToolName; 28 | private final String reason; 29 | 30 | public ErrorSummaryBomToolError(final String bomToolName, final String reason) { 31 | this.bomToolName = bomToolName; 32 | this.reason = reason; 33 | } 34 | 35 | public String getBomToolName() { 36 | return bomToolName; 37 | } 38 | 39 | public String getReason() { 40 | return reason; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/report/util/ReportConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.report.util; 25 | 26 | public class ReportConstants { 27 | public static String RUN_SEPARATOR = "----------------------------------"; 28 | public static String HEADING = "======================================================================================================"; 29 | public static String SEPERATOR = "------------------------------------------------------------------------------------------------------"; 30 | } 31 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/report/util/ReporterUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.report.util; 25 | 26 | import com.blackducksoftware.integration.hub.detect.workflow.report.writer.ReportWriter; 27 | 28 | public class ReporterUtils { 29 | 30 | public static void printHeader(ReportWriter writer, String title) { 31 | writer.writeLine(); 32 | writer.writeHeader(); 33 | writer.writeLine(title); 34 | writer.writeHeader(); 35 | } 36 | 37 | public static void printFooter(ReportWriter writer) { 38 | writer.writeLine(ReportConstants.HEADING); 39 | writer.writeLine(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/report/writer/DebugLogReportWriter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.report.writer; 25 | 26 | import org.slf4j.Logger; 27 | import org.slf4j.LoggerFactory; 28 | 29 | public class DebugLogReportWriter extends LogReportWriter { 30 | private final Logger logger = LoggerFactory.getLogger(this.getClass()); 31 | 32 | @Override 33 | public void writeLine(final String line) { 34 | logger.debug(line); 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/report/writer/InfoLogReportWriter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.report.writer; 25 | 26 | import org.slf4j.Logger; 27 | import org.slf4j.LoggerFactory; 28 | 29 | public class InfoLogReportWriter extends LogReportWriter { 30 | private final Logger logger = LoggerFactory.getLogger(this.getClass()); 31 | 32 | @Override 33 | public void writeLine(final String line) { 34 | logger.info(line); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/report/writer/ReportWriter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.report.writer; 25 | 26 | public interface ReportWriter { 27 | public void writeLine(); 28 | 29 | public void writeLine(final String line); 30 | 31 | public void writeSeperator(); 32 | 33 | public void writeHeader(); 34 | 35 | public void finish(); 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/report/writer/TraceLogReportWriter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.report.writer; 25 | 26 | import org.slf4j.Logger; 27 | import org.slf4j.LoggerFactory; 28 | 29 | public class TraceLogReportWriter extends LogReportWriter { 30 | private final Logger logger = LoggerFactory.getLogger(this.getClass()); 31 | 32 | @Override 33 | public void writeLine(final String line) { 34 | logger.trace(line); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/DetectorSearchFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search; 25 | 26 | import java.io.File; 27 | 28 | public interface DetectorSearchFilter { 29 | boolean shouldExclude(File file); 30 | } 31 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/SearchResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search; 25 | 26 | import java.util.List; 27 | import java.util.Set; 28 | 29 | import com.blackducksoftware.integration.hub.detect.detector.DetectorType; 30 | import com.blackducksoftware.integration.hub.detect.workflow.search.result.DetectorEvaluation; 31 | 32 | public abstract class SearchResult { 33 | public SearchResult() { 34 | } 35 | 36 | public abstract List getDetectorEvaluations(); 37 | 38 | public abstract Set getApplicableBomTools(); 39 | 40 | public abstract boolean getSuccess(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/DetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public abstract class DetectorResult { 27 | public abstract boolean getPassed(); 28 | 29 | public abstract String toDescription(); 30 | } 31 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/ExceptionDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class ExceptionDetectorResult extends FailedDetectorResult { 27 | private final Exception exception; 28 | 29 | public ExceptionDetectorResult(final Exception exception) { 30 | this.exception = exception; 31 | } 32 | 33 | @Override 34 | public String toDescription() { 35 | return "Exception occured: " + exception.getMessage(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/ExcludedDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class ExcludedDetectorResult extends FailedDetectorResult { 27 | @Override 28 | public String toDescription() { 29 | return "Detector type was excluded."; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/ExecutableNotFoundDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class ExecutableNotFoundDetectorResult extends FailedDetectorResult { 27 | private final String executableName; 28 | 29 | public ExecutableNotFoundDetectorResult(final String executableName) { 30 | this.executableName = executableName; 31 | } 32 | 33 | @Override 34 | public String toDescription() { 35 | return "No " + executableName + " executable was found."; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/FailedDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class FailedDetectorResult extends DetectorResult { 27 | @Override 28 | public boolean getPassed() { 29 | return false; 30 | } 31 | 32 | @Override 33 | public String toDescription() { 34 | return "Passed."; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/FileNotFoundDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class FileNotFoundDetectorResult extends FailedDetectorResult { 27 | private final String pattern; 28 | 29 | public FileNotFoundDetectorResult(final String pattern) { 30 | this.pattern = pattern; 31 | } 32 | 33 | @Override 34 | public String toDescription() { 35 | return "No file was found with pattern: " + pattern; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/FilesNotFoundDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | import java.util.Arrays; 27 | import java.util.stream.Collectors; 28 | 29 | public class FilesNotFoundDetectorResult extends FailedDetectorResult { 30 | private final String[] patterns; 31 | 32 | public FilesNotFoundDetectorResult(final String... patterns) { 33 | this.patterns = patterns; 34 | } 35 | 36 | @Override 37 | public String toDescription() { 38 | return "No files were found with any of the patterns: " + Arrays.asList(patterns).stream().collect(Collectors.joining(",")); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/ForcedNestedPassedDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class ForcedNestedPassedDetectorResult extends DetectorResult { 27 | @Override 28 | public boolean getPassed() { 29 | return true; 30 | } 31 | 32 | @Override 33 | public String toDescription() { 34 | return "Forced to pass because nested forced by user."; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/InspectorNotFoundDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class InspectorNotFoundDetectorResult extends FailedDetectorResult { 27 | private final String inspectorName; 28 | 29 | public InspectorNotFoundDetectorResult(final String inspectorName) { 30 | this.inspectorName = inspectorName; 31 | } 32 | 33 | @Override 34 | public String toDescription() { 35 | return "No " + inspectorName + " inspector was found."; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/MaxDepthExceededDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class MaxDepthExceededDetectorResult extends FailedDetectorResult { 27 | private final int depth; 28 | private final int maxDepth; 29 | 30 | public MaxDepthExceededDetectorResult(final int depth, final int maxDepth) { 31 | this.depth = depth; 32 | this.maxDepth = maxDepth; 33 | } 34 | 35 | @Override 36 | public String toDescription() { 37 | return "Max depth of " + maxDepth + " exceeded by " + depth; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/NotNestableDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class NotNestableDetectorResult extends FailedDetectorResult { 27 | @Override 28 | public String toDescription() { 29 | return "Not nestable and a detector already applied in parent directory."; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/NotSelfNestableDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class NotSelfNestableDetectorResult extends FailedDetectorResult { 27 | @Override 28 | public String toDescription() { 29 | return "Nestable but this detector already applied in a parent directory."; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/NpmRunInstallDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class NpmRunInstallDetectorResult extends FailedDetectorResult { 27 | private final String directoryPath; 28 | 29 | public NpmRunInstallDetectorResult(final String directoryPath) { 30 | this.directoryPath = directoryPath; 31 | } 32 | 33 | @Override 34 | public String toDescription() { 35 | return String.format("A package.json was located in %s, but the node_modules folder was NOT located. Please run 'npm install' in that location and try again.", directoryPath); 36 | } 37 | } -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/PassedDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class PassedDetectorResult extends DetectorResult { 27 | @Override 28 | public boolean getPassed() { 29 | return true; 30 | } 31 | 32 | @Override 33 | public String toDescription() { 34 | return "Passed."; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/PropertyInsufficientDetectorResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | public class PropertyInsufficientDetectorResult extends FailedDetectorResult { 27 | @Override 28 | public String toDescription() { 29 | return "The properties are insufficient to run."; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/search/result/WrongOperatingSystemResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.search.result; 25 | 26 | import com.blackducksoftware.integration.hub.detect.type.OperatingSystemType; 27 | 28 | public class WrongOperatingSystemResult extends FailedDetectorResult { 29 | private final OperatingSystemType currentOperatingSystem; 30 | 31 | public WrongOperatingSystemResult(final OperatingSystemType currentOperatingSystem) { 32 | this.currentOperatingSystem = currentOperatingSystem; 33 | } 34 | 35 | @Override 36 | public String toDescription() { 37 | return String.format("Cannot run on %s", currentOperatingSystem.toString()); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/status/BinaryScanStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.status; 25 | 26 | public class BinaryScanStatus { 27 | } 28 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/status/DetectorStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.status; 25 | 26 | import com.blackducksoftware.integration.hub.detect.detector.DetectorType; 27 | 28 | public class DetectorStatus extends Status { 29 | public DetectorStatus(final DetectorType detectorType, final StatusType statusType) { 30 | super(detectorType.toString(), statusType); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/status/DockerStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.status; 25 | 26 | public class DockerStatus { 27 | } 28 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/status/SignatureScanStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.status; 25 | 26 | import com.synopsys.integration.blackduck.codelocation.Result; 27 | 28 | public class SignatureScanStatus extends Status { 29 | public SignatureScanStatus(final String scanTargetPath, final Result result) { 30 | this(scanTargetPath, result == Result.SUCCESS ? StatusType.SUCCESS : StatusType.FAILURE); 31 | } 32 | 33 | public SignatureScanStatus(final String scanTargetPath, final StatusType statusType) { 34 | super("Scan Target " + scanTargetPath, statusType); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/status/Status.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.status; 25 | 26 | public class Status { 27 | private final String descriptionKey; 28 | private final StatusType statusType; 29 | 30 | public Status(final String descriptionKey, final StatusType statusType) { 31 | this.descriptionKey = descriptionKey; 32 | this.statusType = statusType; 33 | } 34 | 35 | public String getDescriptionKey() { 36 | return descriptionKey; 37 | } 38 | 39 | public StatusType getStatusType() { 40 | return statusType; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/workflow/status/StatusType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * hub-detect 3 | * 4 | * Copyright (C) 2019 Black Duck Software, Inc. 5 | * http://www.blackducksoftware.com/ 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | */ 24 | package com.blackducksoftware.integration.hub.detect.workflow.status; 25 | 26 | public enum StatusType { 27 | SUCCESS, 28 | FAILURE 29 | } 30 | -------------------------------------------------------------------------------- /hub-detect/src/main/resources/application-diagnostic.properties: -------------------------------------------------------------------------------- 1 | logging.level.com.blackducksoftware.integration=ALL 2 | logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} ${LOG_LEVEL_PATTERN:%-6p}[%thread] %clr(---){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:%wEx} -------------------------------------------------------------------------------- /hub-detect/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # New properties should not be added here. They should be added to DetectConfiguration. 2 | logging.level.com.blackducksoftware.integration=INFO 3 | logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} ${LOG_LEVEL_PATTERN:%-6p}[%thread] %clr(---){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:%wEx} 4 | -------------------------------------------------------------------------------- /hub-detect/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | `.:/oo/-` 4 | `+dNNMMMMNmy: `-+` 5 | -dNMMMMMMMMMMNy:../dmd. 6 | .dNMMMMMMMMMMMMMNNNNNN+ 7 | +NNMMMMMMMMMMMMMMMMMNm-`` 8 | oNMMMMMMMMMMMMMMMMMMMNmhy/` 9 | /NNMMMMMMMMMMMMMMMMMMMmy/. ______ _ _ 10 | `yNMMMMMMMMMMMMMMMMMNy:` | _ \ | | | | 11 | .hNMMMMMMMMMMMMMMMN+` | | | |___| |_ ___ ___| |_ 12 | `.` `+hNMMMMMMMMMMMMNd` | | | / _ \ __/ _ \/ __| __| 13 | .hmhs:` `/mNMMMMMMMMMMMm+.` | |/ / __/ || __/ (__| |_ 14 | :NMMNNdyo//+osyhhhyhNMMMMMMMMMMMMMNmh+- |___/ \___|\__\___|\___|\__| 15 | -NMMMMMMMNNNMMMMMMMMMMMMMMMMMMMMMMMMMNms- 16 | `dNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNm:` 17 | oNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNd. 18 | .mNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN: 19 | /mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN: 20 | `/NNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNh` 21 | -smNMMNNNMMMMMMMMMMMMMMMMMMMMMMMNNNds. 22 | `.--::////+++ooooooooooo++////::-` 23 | 24 | -------------------------------------------------------------------------------- /hub-detect/src/main/resources/buildInfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect": "2.1.0" 3 | } -------------------------------------------------------------------------------- /hub-detect/src/test/groovy/com/blackducksoftware/integration/hub/detect/detector/DetectorTypeTest.java: -------------------------------------------------------------------------------- 1 | package com.blackducksoftware.integration.hub.detect.detector; 2 | 3 | import static org.junit.Assert.assertFalse; 4 | import static org.junit.Assert.assertTrue; 5 | 6 | import org.junit.Test; 7 | 8 | public class DetectorTypeTest { 9 | @Test 10 | public void testFoundName() { 11 | assertTrue(DetectorType.POSSIBLE_NAMES.contains(DetectorType.COCOAPODS.name())); 12 | } 13 | 14 | @Test 15 | public void testNotFoundName() { 16 | assertFalse(DetectorType.POSSIBLE_NAMES.contains("quoth the raven - NEVERMORE!")); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /hub-detect/src/test/groovy/com/blackducksoftware/integration/hub/detect/detector/bitbake/BitbakeListTasksParserTest.java: -------------------------------------------------------------------------------- 1 | package com.blackducksoftware.integration.hub.detect.detector.bitbake; 2 | 3 | import java.util.Optional; 4 | 5 | import org.junit.Test; 6 | 7 | import com.blackducksoftware.integration.hub.detect.testutils.TestUtil; 8 | 9 | public class BitbakeListTasksParserTest { 10 | @Test 11 | public void parseTargetArchitectureTest() { 12 | final TestUtil testUtil = new TestUtil(); 13 | final String listtaskOutput = testUtil.getResourceAsUTF8String("/bitbake/listtasks_output.txt"); 14 | final BitbakeListTasksParser bitbakeListTasksParser = new BitbakeListTasksParser(); 15 | final Optional architecture = bitbakeListTasksParser.parseTargetArchitecture(listtaskOutput); 16 | 17 | assert architecture.isPresent(); 18 | System.out.println(architecture.get()); 19 | assert architecture.get().equals("i586-poky-linux"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /hub-detect/src/test/groovy/com/blackducksoftware/integration/hub/detect/detector/bitbake/GraphParserTransformerTest.java: -------------------------------------------------------------------------------- 1 | package com.blackducksoftware.integration.hub.detect.detector.bitbake; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | import org.junit.Test; 7 | import org.springframework.core.io.ClassPathResource; 8 | 9 | import com.paypal.digraph.parser.GraphParser; 10 | import com.synopsys.integration.bdio.graph.DependencyGraph; 11 | 12 | public class GraphParserTransformerTest { 13 | @Test 14 | public void transform() throws IOException { 15 | final GraphParserTransformer graphParserTransformer = new GraphParserTransformer(); 16 | final InputStream inputStream = new ClassPathResource("/bitbake/recipe-depends.dot").getInputStream(); 17 | final GraphParser graphParser = new GraphParser(inputStream); 18 | final DependencyGraph dependencyGraph = graphParserTransformer.transform(graphParser, "i586-poky-linux"); 19 | 20 | assert dependencyGraph.getRootDependencies().size() == 480; 21 | } 22 | } -------------------------------------------------------------------------------- /hub-detect/src/test/groovy/com/blackducksoftware/integration/hub/detect/detector/npm/NpmOutputParserTest.java: -------------------------------------------------------------------------------- 1 | package com.blackducksoftware.integration.hub.detect.detector.npm; 2 | 3 | import java.io.IOException; 4 | 5 | import org.junit.Assert; 6 | import org.junit.Test; 7 | 8 | import com.blackducksoftware.integration.hub.detect.testutils.DependencyGraphResourceTestUtil; 9 | import com.blackducksoftware.integration.hub.detect.testutils.TestUtil; 10 | import com.synopsys.integration.bdio.model.externalid.ExternalIdFactory; 11 | 12 | public class NpmOutputParserTest { 13 | private final TestUtil testUtil = new TestUtil(); 14 | 15 | @Test 16 | public void npmCliDependencyFinder() throws IOException { 17 | final NpmCliParser parser = new NpmCliParser(new ExternalIdFactory()); 18 | final String testIn = testUtil.getResourceAsUTF8String("/npm/packman_proj_dependencies.json"); 19 | final NpmParseResult result = parser.convertNpmJsonFileToCodeLocation("source", testIn); 20 | 21 | Assert.assertEquals(result.projectName, "node-js"); 22 | Assert.assertEquals(result.projectVersion, "0.2.0"); 23 | DependencyGraphResourceTestUtil.assertGraph("/npm/npmParseOutput_graph.json", result.codeLocation.getDependencyGraph()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /hub-detect/src/test/groovy/com/blackducksoftware/integration/hub/detect/tool/bazel/BazelCodeLocationBuilderTest.java: -------------------------------------------------------------------------------- 1 | package com.blackducksoftware.integration.hub.detect.tool.bazel; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import java.io.File; 6 | import java.util.List; 7 | 8 | import org.junit.Test; 9 | 10 | import com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocation; 11 | import com.synopsys.integration.bdio.model.dependency.Dependency; 12 | import com.synopsys.integration.bdio.model.externalid.ExternalIdFactory; 13 | 14 | public class BazelCodeLocationBuilderTest { 15 | 16 | @Test 17 | public void test() { 18 | BazelCodeLocationBuilder bdioBuilder = new BazelCodeLocationBuilder(new ExternalIdFactory()); 19 | final List codeLocations = bdioBuilder.setWorkspaceDir(new File("src/test/resources/bazel/multiLevel")) 20 | .addDependency(BazelExternalId.fromBazelArtifactString("testGroup:testArtifact:testVersion", ":")) 21 | .build(); 22 | 23 | assertEquals(1, codeLocations.size()); 24 | assertEquals("src/test/resources/bazel/multiLevel", codeLocations.get(0).getExternalId().path); 25 | assertEquals(1, codeLocations.get(0).getDependencyGraph().getRootDependencies().size()); 26 | 27 | Dependency dep = codeLocations.get(0).getDependencyGraph().getRootDependencies().iterator().next(); 28 | assertEquals("testArtifact", dep.name); 29 | assertEquals("testVersion", dep.version); 30 | assertEquals("testGroup", dep.externalId.group); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /hub-detect/src/test/groovy/com/blackducksoftware/integration/hub/detect/util/DirectoryManagerTest.java: -------------------------------------------------------------------------------- 1 | package com.blackducksoftware.integration.hub.detect.util; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import com.blackducksoftware.integration.hub.detect.workflow.file.DetectFileFinder; 7 | 8 | public class DirectoryManagerTest { 9 | @Test 10 | public void extractFinalPieceFromPath() { 11 | final DetectFileFinder detectFileManager = new DetectFileFinder(); 12 | Assert.assertEquals("a", detectFileManager.extractFinalPieceFromPath("/a")); 13 | Assert.assertEquals("a", detectFileManager.extractFinalPieceFromPath("/a/")); 14 | Assert.assertEquals("c", detectFileManager.extractFinalPieceFromPath("/a/b/c")); 15 | Assert.assertEquals("c", detectFileManager.extractFinalPieceFromPath("/a/b/c/")); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /hub-detect/src/test/groovy/com/blackducksoftware/integration/hub/detect/util/TildeInPathResolverTest.java: -------------------------------------------------------------------------------- 1 | package com.blackducksoftware.integration.hub.detect.util; 2 | 3 | import java.util.Optional; 4 | 5 | import org.junit.Assert; 6 | import org.junit.Test; 7 | 8 | import com.blackducksoftware.integration.hub.detect.type.OperatingSystemType; 9 | 10 | public class TildeInPathResolverTest { 11 | @Test 12 | public void testResolvingTilde() throws IllegalArgumentException, IllegalAccessException { 13 | final TildeInPathResolver resolver = new TildeInPathResolver("/Users/ekerwin", OperatingSystemType.LINUX); 14 | 15 | final Optional resolved = resolver.resolveTildeInValue("~/Documents/source/integration/hub-detect"); 16 | 17 | Assert.assertEquals("/Users/ekerwin/Documents/source/integration/hub-detect", resolved.get()); 18 | } 19 | 20 | @Test 21 | public void testResolvingTildeInWindows() throws IllegalArgumentException, IllegalAccessException { 22 | final TildeInPathResolver resolver = new TildeInPathResolver("/Users/ekerwin", OperatingSystemType.WINDOWS); 23 | 24 | final Optional resolved = resolver.resolveTildeInValue("~/Documents/source/integration/hub-detect"); 25 | 26 | Assert.assertFalse(resolved.isPresent()); 27 | } 28 | 29 | @Test 30 | public void testResolvingTildeInTheMiddleOfAPath() throws IllegalArgumentException, IllegalAccessException { 31 | final TildeInPathResolver resolver = new TildeInPathResolver("/Users/ekerwin", OperatingSystemType.LINUX); 32 | 33 | final Optional resolved = resolver.resolveTildeInValue("/Documents/~source/~/integration/hub-detect"); 34 | 35 | Assert.assertFalse(resolved.isPresent()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/README.md: -------------------------------------------------------------------------------- 1 | # Bazel example projects 2 | 3 | This directory contains few Bazel projects written in different languages and is used to verify Bazel support in the build pipeline. 4 | 5 | Bazel example projects are based on: 6 | https://github.com/bazelbuild/bazel/tree/master/examples 7 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/WORKSPACE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/hub-detect/dc528aa57240fc849f19a19d666564176a6b9679/hub-detect/src/test/resources/bazel/multiLevel/WORKSPACE -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/java/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "greeting", 5 | srcs = ["src/main/resources/greeting.txt"], 6 | ) 7 | 8 | java_binary( 9 | name = "hello-world", 10 | main_class = "com.example.myproject.Greeter", 11 | runtime_deps = [":hello-lib"], 12 | ) 13 | 14 | java_library( 15 | name = "hello-lib", 16 | srcs = ["src/main/java/com/example/myproject/Greeter.java"], 17 | ) 18 | 19 | java_binary( 20 | name = "hello-resources", 21 | main_class = "com.example.myproject.Greeter", 22 | runtime_deps = [":custom-greeting"], 23 | ) 24 | 25 | java_library( 26 | name = "custom-greeting", 27 | srcs = ["src/main/java/com/example/myproject/Greeter.java"], 28 | resources = ["//pipeline/samples/bazel/java:greeting"], 29 | ) 30 | 31 | java_test( 32 | name = "hello", 33 | srcs = ["src/test/java/com/example/myproject/TestHello.java"], 34 | test_class = "com.example.myproject.TestHello", 35 | deps = [ 36 | "//pipeline/samples/bazel/java:hello-lib", 37 | "//3rdparty/jvm/junit:junit", 38 | ], 39 | ) 40 | 41 | java_test( 42 | name = "custom", 43 | srcs = ["src/test/java/com/example/myproject/TestCustomGreeting.java"], 44 | test_class = "com.example.myproject.TestCustomGreeting", 45 | deps = [ 46 | "//pipeline/samples/bazel/java:custom-greeting", 47 | "//3rdparty/jvm/junit:junit", 48 | ], 49 | ) -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/java/README.md: -------------------------------------------------------------------------------- 1 | # Java Bazel example 2 | 3 | ##### Build: 4 | 5 | bazel build //pipeline/samples/bazel/java:hello-world 6 | bazel build //pipeline/samples/bazel/java:hello-resources 7 | 8 | ##### Run: 9 | 10 | bazel run //pipeline/samples/bazel/java:hello-world 11 | bazel run //pipeline/samples/bazel/java:hello-resources 12 | 13 | ##### Test: 14 | 15 | ###### All: 16 | 17 | bazel test //pipeline/samples/bazel/java/... 18 | 19 | ###### Specific: 20 | 21 | bazel test //pipeline/samples/bazel/java:hello 22 | bazel test //pipeline/samples/bazel/java:custom 23 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/java/src/main/resources/greeting.txt: -------------------------------------------------------------------------------- 1 | Bye 2 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/java/src/test/java/com/example/myproject/TestCustomGreeting.java: -------------------------------------------------------------------------------- 1 | package com.example.myproject; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Test; 6 | 7 | import java.io.ByteArrayOutputStream; 8 | import java.io.PrintStream; 9 | import java.nio.charset.StandardCharsets; 10 | 11 | /** 12 | * Tests using a resource file to replace "Hello" in the output. 13 | */ 14 | public class TestCustomGreeting { 15 | 16 | @Test 17 | public void testNoArgument() throws Exception { 18 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 19 | Greeter.out = new PrintStream(out); 20 | Greeter.main(); 21 | assertEquals("Bye world", new String(out.toByteArray(), StandardCharsets.UTF_8).trim()); 22 | } 23 | 24 | @Test 25 | public void testWithArgument() throws Exception { 26 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 27 | Greeter.out = new PrintStream(out); 28 | Greeter.main("toto"); 29 | assertEquals("Bye toto", new String(out.toByteArray(), StandardCharsets.UTF_8).trim()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/java/src/test/java/com/example/myproject/TestHello.java: -------------------------------------------------------------------------------- 1 | package com.example.myproject; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Test; 6 | 7 | import java.io.ByteArrayOutputStream; 8 | import java.io.PrintStream; 9 | import java.nio.charset.StandardCharsets; 10 | 11 | /** 12 | * Tests different numbers of arguments to main(). 13 | * 14 | *

With an empty args array, {@link Greeter} should print "Hello world". If there are one or more 15 | * args, {@link Greeter} should print "Hello <arg[0]>".

16 | */ 17 | public class TestHello { 18 | 19 | @Test 20 | public void testNoArgument() throws Exception { 21 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 22 | Greeter.out = new PrintStream(out); 23 | Greeter.main(); 24 | assertEquals("Hello world", new String(out.toByteArray(), StandardCharsets.UTF_8).trim()); 25 | } 26 | 27 | @Test 28 | public void testWithArgument() throws Exception { 29 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 30 | Greeter.out = new PrintStream(out); 31 | Greeter.main("toto"); 32 | assertEquals("Hello toto", new String(out.toByteArray(), StandardCharsets.UTF_8).trim()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/python/BUILD: -------------------------------------------------------------------------------- 1 | filegroup( 2 | name = "srcs", 3 | srcs = glob(["*.py"]) + [ 4 | "BUILD", 5 | "//pipeline/samples/bazel/python/fibonacci:srcs", 6 | ], 7 | visibility = ["//pipeline/samples/bazel:__pkg__"], 8 | ) 9 | 10 | py_binary( 11 | name = "bin", 12 | srcs = ["bin.py"], 13 | deps = [ 14 | ":lib", 15 | "//pipeline/samples/bazel/python/fibonacci", 16 | ], 17 | ) 18 | 19 | py_library( 20 | name = "lib", 21 | srcs = ["lib.py"], 22 | ) 23 | 24 | py_test( 25 | name = "test", 26 | srcs = ["test.py"], 27 | deps = [ 28 | ":lib", 29 | "//pipeline/samples/bazel/python/fibonacci", 30 | ], 31 | ) 32 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/python/README.md: -------------------------------------------------------------------------------- 1 | # Python Bazel example 2 | 3 | ##### Build: 4 | 5 | bazel build //pipeline/samples/bazel/python:bin 6 | 7 | ##### Run: 8 | 9 | bazel run //pipeline/samples/bazel/python:bin 10 | 11 | ##### Test: 12 | 13 | bazel test //pipeline/samples/bazel/python:test 14 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/python/bin.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=superfluous-parens 2 | """A tiny example binary for the native Python rules of Bazel.""" 3 | from pipeline.samples.bazel.python.lib import GetNumber 4 | from fib import Fib 5 | 6 | print("The number is %d" % GetNumber()) 7 | print("Fib(5) == %d" % Fib(5)) 8 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/python/fibonacci/BUILD: -------------------------------------------------------------------------------- 1 | filegroup( 2 | name = "srcs", 3 | srcs = glob(["*.py"]) + [ 4 | "BUILD", 5 | ], 6 | visibility = ["//pipeline/samples/bazel/python:__pkg__"], 7 | ) 8 | 9 | py_library( 10 | name = "fibonacci", 11 | srcs = ["fib.py"], 12 | imports = ["."], 13 | visibility = ["//pipeline/samples/bazel/python:__pkg__"], 14 | ) 15 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/python/fibonacci/fib.py: -------------------------------------------------------------------------------- 1 | """An example binary to test the imports attribute of native Python rules.""" 2 | 3 | 4 | def Fib(n): 5 | if n == 0 or n == 1: 6 | return 1 7 | else: 8 | return Fib(n-1) + Fib(n-2) 9 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/python/lib.py: -------------------------------------------------------------------------------- 1 | """A tiny example binary for the native Python rules of Bazel.""" 2 | 3 | 4 | def GetNumber(): 5 | return 42 6 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/bazel/multiLevel/python/test.py: -------------------------------------------------------------------------------- 1 | """A tiny example binary for the native Python rules of Bazel.""" 2 | 3 | import unittest 4 | from pipeline.samples.bazel.python.lib import GetNumber 5 | from fib import Fib 6 | 7 | 8 | class TestGetNumber(unittest.TestCase): 9 | 10 | def test_ok(self): 11 | self.assertEquals(GetNumber(), 42) 12 | 13 | def test_fib(self): 14 | self.assertEquals(Fib(5), 8) 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/clang/source/build/compile_commands.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "directory": "src/test/resources/clang/source", 4 | "command": "gcc hello_world.cpp", 5 | "file": "src/test/resources/clang/source/hello_world.cpp" 6 | }, 7 | { 8 | "directory": "src/test/resources/clang/source", 9 | "command": "gcc goodbye_world.cpp", 10 | "file": "src/test/resources/clang/source/goodbye_world.cpp" 11 | } 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/clang/source/build/compile_commands_usesArguments.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "directory": "src/test/resources/clang/source", 4 | "arguments": [ 5 | "gcc", 6 | "hello_world.cpp" 7 | ], 8 | "file": "src/test/resources/clang/source/hello_world.cpp" 9 | }, 10 | { 11 | "directory": "src/test/resources/clang/source", 12 | "arguments": [ 13 | "gcc", 14 | "goodbye_world.cpp" 15 | ], 16 | "file": "src/test/resources/clang/source/goodbye_world.cpp" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/clang/source/myinclude.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/hub-detect/dc528aa57240fc849f19a19d666564176a6b9679/hub-detect/src/test/resources/clang/source/myinclude.h -------------------------------------------------------------------------------- /hub-detect/src/test/resources/cocoapods/simpleExpected.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Allihoopa-macOS", 4 | "version": "1.1.0", 5 | "externalId": { 6 | "name": "Allihoopa-macOS", 7 | "version": "1.1.0", 8 | "forge": { 9 | "name": "cocoapods", 10 | "separator": ":" 11 | } 12 | }, 13 | "children": [ 14 | { 15 | "name": "AllihoopaCore", 16 | "version": "1.1.0", 17 | "externalId": { 18 | "name": "AllihoopaCore", 19 | "version": "1.1.0", 20 | "forge": { 21 | "name": "cocoapods", 22 | "separator": ":" 23 | } 24 | }, 25 | "children": [ 26 | 27 | ] 28 | } 29 | ] 30 | }, 31 | { 32 | "name": "Mapbox-macOS-SDK", 33 | "version": "0.4.1", 34 | "externalId": { 35 | "name": "Mapbox-macOS-SDK", 36 | "version": "0.4.1", 37 | "forge": { 38 | "name": "cocoapods", 39 | "separator": ":" 40 | } 41 | }, 42 | "children": [ 43 | 44 | ] 45 | }, 46 | { 47 | "name": "RepliesSDK-macOS", 48 | "version": "0.2.22", 49 | "externalId": { 50 | "name": "RepliesSDK-macOS", 51 | "version": "0.2.22", 52 | "forge": { 53 | "name": "cocoapods", 54 | "separator": ":" 55 | } 56 | }, 57 | "children": [ 58 | 59 | ] 60 | } 61 | ] -------------------------------------------------------------------------------- /hub-detect/src/test/resources/cocoapods/simpleExpected_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:cocoapods/Allihoopa_macOS/1_1_0": [ 4 | "http:cocoapods/AllihoopaCore/1_1_0" 5 | ], 6 | "http:cocoapods/AllihoopaCore/1_1_0": [], 7 | "http:cocoapods/Mapbox_macOS_SDK/0_4_1": [], 8 | "http:cocoapods/RepliesSDK_macOS/0_2_22": [] 9 | }, 10 | "dependencySummaries": { 11 | "http:cocoapods/Allihoopa_macOS/1_1_0": { 12 | "name": "Allihoopa-macOS", 13 | "version": "1.1.0" 14 | }, 15 | "http:cocoapods/AllihoopaCore/1_1_0": { 16 | "name": "AllihoopaCore", 17 | "version": "1.1.0" 18 | }, 19 | "http:cocoapods/Mapbox_macOS_SDK/0_4_1": { 20 | "name": "Mapbox-macOS-SDK", 21 | "version": "0.4.1" 22 | }, 23 | "http:cocoapods/RepliesSDK_macOS/0_2_22": { 24 | "name": "RepliesSDK-macOS", 25 | "version": "0.2.22" 26 | } 27 | }, 28 | "rootExternalDataIds": [ 29 | "http:cocoapods/Allihoopa_macOS/1_1_0", 30 | "http:cocoapods/Mapbox_macOS_SDK/0_4_1", 31 | "http:cocoapods/RepliesSDK_macOS/0_2_22" 32 | ] 33 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/cocoapods/simplePodfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Allihoopa-macOS (1.1.0): 3 | - AllihoopaCore (~> 1.1.0) 4 | - AllihoopaCore (1.1.0) 5 | - Mapbox-macOS-SDK (0.4.1) 6 | - RepliesSDK-macOS (0.2.22) 7 | 8 | DEPENDENCIES: 9 | - Allihoopa-macOS (~> 1.1) 10 | - Mapbox-macOS-SDK (~> 0.4) 11 | - RepliesSDK-macOS (~> 0.2) 12 | 13 | SPEC CHECKSUMS: 14 | Allihoopa-macOS: 5c2fb29ed9d4266bc3ba0b3ec3ef7d937cd856f6 15 | AllihoopaCore: 78c8c6695856b376ae4c6bb2385bcd8de099dfbc 16 | Mapbox-macOS-SDK: 942319f0f1567b7fc9f5bb452428331a4ba4990a 17 | RepliesSDK-macOS: 42c5f6956a1cebb259e8334e21cb6d04e70813a7 18 | 19 | PODFILE CHECKSUM: cf96735ee6b7cfa92b1189e11efbd4406137e30f 20 | 21 | COCOAPODS: 1.2.0 22 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/cpan/expectedDependencyNodes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "ExtUtils-MakeMaker", 4 | "version": "7.24", 5 | "externalId": { 6 | "name": "ExtUtils-MakeMaker", 7 | "version": "7.24", 8 | "forge": { 9 | "name": "cpan", 10 | "separator": "-" 11 | } 12 | }, 13 | "children": [] 14 | }, 15 | { 16 | "name": "Test-More", 17 | "version": "1.302073", 18 | "externalId": { 19 | "name": "Test-More", 20 | "version": "1.302073", 21 | "forge": { 22 | "name": "cpan", 23 | "separator": "-" 24 | } 25 | }, 26 | "children": [] 27 | } 28 | ] -------------------------------------------------------------------------------- /hub-detect/src/test/resources/cpan/expectedDependencyNodes_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:cpan/ExtUtils_MakeMaker/7_24": [], 4 | "http:cpan/Test_More/1_302073": [] 5 | }, 6 | "dependencySummaries": { 7 | "http:cpan/ExtUtils_MakeMaker/7_24": { 8 | "name": "ExtUtils-MakeMaker", 9 | "version": "7.24" 10 | }, 11 | "http:cpan/Test_More/1_302073": { 12 | "name": "Test-More", 13 | "version": "1.302073" 14 | } 15 | }, 16 | "rootExternalDataIds": [ 17 | "http:cpan/ExtUtils_MakeMaker/7_24", 18 | "http:cpan/Test_More/1_302073" 19 | ] 20 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/cpan/showDeps.txt: -------------------------------------------------------------------------------- 1 | --> Working on . 2 | Configuring App-cpanminus-1.7043 ... OK 3 | ExtUtils::MakeMaker~6.58 4 | Test::More 5 | perl~5.008001 6 | ExtUtils::MakeMaker -------------------------------------------------------------------------------- /hub-detect/src/test/resources/fileFinder/sub1/subsub/test1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/hub-detect/dc528aa57240fc849f19a19d666564176a6b9679/hub-detect/src/test/resources/fileFinder/sub1/subsub/test1.txt -------------------------------------------------------------------------------- /hub-detect/src/test/resources/fileFinder/sub1/subsub/test2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/hub-detect/dc528aa57240fc849f19a19d666564176a6b9679/hub-detect/src/test/resources/fileFinder/sub1/subsub/test2.txt -------------------------------------------------------------------------------- /hub-detect/src/test/resources/fileFinder/sub2/subsub/test3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/hub-detect/dc528aa57240fc849f19a19d666564176a6b9679/hub-detect/src/test/resources/fileFinder/sub2/subsub/test3.txt -------------------------------------------------------------------------------- /hub-detect/src/test/resources/fileFinder/test0.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/hub-detect/dc528aa57240fc849f19a19d666564176a6b9679/hub-detect/src/test/resources/fileFinder/test0.txt -------------------------------------------------------------------------------- /hub-detect/src/test/resources/go/vendor/vendor.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": "", 3 | "ignore": "test", 4 | "package": [ 5 | { 6 | "checksumSHA1": "DTy0iJ2w5C+FDsN9EnzfhNmvS+o=", 7 | "path": "github.com/pkg/errors", 8 | "revision": "059132a15dd08d6704c67711dae0cf35ab991756", 9 | "revisionTime": "2018-10-23T23:59:46Z" 10 | }, 11 | { 12 | "checksumSHA1": "Ykp1hHqP+5CeV/MymOaxS2zblb4=", 13 | "path": "github.com/pkg/math", 14 | "revision": "f2ed9e40e245cdeec72c4b642d27ed4553f90667", 15 | "revisionTime": "2014-10-27T22:47:58Z" 16 | }, 17 | { 18 | "path": "https://github.com/google/glog", 19 | "revision": "" 20 | } 21 | ], 22 | "rootPath": "synopsys.com/integration/hello" 23 | } 24 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/gradle/gradle_implementations_dependencyGraph.txt: -------------------------------------------------------------------------------- 1 | implementation - Implementation only dependencies for 'main' sources. (n) 2 | +--- unspecified (n) 3 | +--- com.android.support:appcompat-v7:27.1.1 (n) 4 | +--- com.android.support.constraint:constraint-layout:1.1.0 (n) 5 | +--- project zdcmap (n) 6 | +--- com.squareup.retrofit2:retrofit:2.4.0 (n) 7 | +--- com.fasterxml.jackson.core:jackson-databind:2.9.5 (n) 8 | +--- com.squareup.retrofit2:converter-jackson:2.4.0 (n) 9 | +--- de.mindpipe.android:android-logging-log4j:1.0.3 (n) 10 | \--- log4j:log4j:1.2.17 (n) -------------------------------------------------------------------------------- /hub-detect/src/test/resources/gradle/maven-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.blackducksoftware.integration 4 | integration-gradle-inspector 5 | 6 | 1.1.0 7 | 1.1.0 8 | 9 | 0.0.1 10 | 0.0.2 11 | 0.0.3 12 | 0.0.4 13 | 0.0.5 14 | 0.0.6 15 | 0.0.7 16 | 0.1.0 17 | 0.2.0 18 | 0.2.1 19 | 0.2.2 20 | 0.3.0 21 | 0.3.1 22 | 0.4.0 23 | 0.5.0 24 | 0.5.1 25 | 0.6.0 26 | 0.7.0 27 | 1.0.0 28 | 1.1.0 29 | 30 | 20180726195440 31 | 32 | 33 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/gradle/parse-tests/complex_dependencyGraph.txt: -------------------------------------------------------------------------------- 1 | 2 | ------------------------------------------------------------ 3 | Project :complex-test - Tests different project positions, components and opening characters 4 | ------------------------------------------------------------ 5 | 6 | archives - test that we can handle no dependencies 7 | No dependencies 8 | 9 | projectTest - test that this project dependency does not show up 10 | \--- project :child-project 11 | 12 | junitTest - test an only component under a config that opens with indicator 13 | \--- solo:component:4.12 14 | 15 | dependency - Compile classpath for source set 'main'. 16 | +--- project :nested-parent 17 | | \--- project :nested-child 18 | \--- non-project:with-nested:1.0.0 19 | 20 | compile 21 | +--- project :spring-webflux 22 | | +--- project :spring-beans (*) 23 | | +--- project :spring-core (*) 24 | | +--- project :spring-web (*) 25 | | \--- should-suppress:project-child: -> 6 26 | +--- some.group:parent:5.0.0 27 | | \--- some.group:child:2.2.2 28 | \--- terminal:child:6.2.3 -------------------------------------------------------------------------------- /hub-detect/src/test/resources/gradle/rootProjectMetadata.txt: -------------------------------------------------------------------------------- 1 | DETECT META DATA START 2 | rootProjectPath:/Users/ekerwin/Documents/source/integration/hub-detect 3 | rootProjectGroup:com.blackducksoftware.integration 4 | rootProjectName:hub-detect 5 | rootProjectVersion:2.0.0-SNAPSHOT 6 | DETECT META DATA END -------------------------------------------------------------------------------- /hub-detect/src/test/resources/hex/dependencyTree.txt: -------------------------------------------------------------------------------- 1 | └─ project─1.0.0 (project app) 2 | ├─ git_inner_parent_dependency─0.0.2 (git repo) 3 | │ ├─ hex_inner_child_dependency─0.3.0 (hex package) 4 | │ │ └─ hex_grandchild_dependency─4.0.0 (hex package) 5 | │ └─ git_inner_child_dependency─0.5.0 (git repo) 6 | │ └─ git_grandchild_dependency─6.0.0 (git repo) 7 | └─ git_outer_parent_dependency─0.0.7 (git repo) 8 | └─ git_outer_child_dependency─0.8.0 (git repo) -------------------------------------------------------------------------------- /hub-detect/src/test/resources/npm/npmParseOutput_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:npm/upper_case/1_1_3": [], 4 | "http:npm/xml2js/0_4_17": [ 5 | "http:npm/sax/1_2_2", 6 | "http:npm/xmlbuilder/4_2_1" 7 | ], 8 | "http:npm/sax/1_2_2": [], 9 | "http:npm/xmlbuilder/4_2_1": [ 10 | "http:npm/lodash/4_17_4" 11 | ], 12 | "http:npm/lodash/4_17_4": [] 13 | }, 14 | "dependencySummaries": { 15 | "http:npm/upper_case/1_1_3": { 16 | "name": "upper-case", 17 | "version": "1.1.3" 18 | }, 19 | "http:npm/xml2js/0_4_17": { 20 | "name": "xml2js", 21 | "version": "0.4.17" 22 | }, 23 | "http:npm/sax/1_2_2": { 24 | "name": "sax", 25 | "version": "1.2.2" 26 | }, 27 | "http:npm/xmlbuilder/4_2_1": { 28 | "name": "xmlbuilder", 29 | "version": "4.2.1" 30 | }, 31 | "http:npm/lodash/4_17_4": { 32 | "name": "lodash", 33 | "version": "4.17.4" 34 | } 35 | }, 36 | "rootExternalDataIds": [ 37 | "http:npm/upper_case/1_1_3", 38 | "http:npm/xml2js/0_4_17" 39 | ] 40 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/npm/packman_proj_dependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-js", 3 | "version": "0.2.0", 4 | "dependencies": { 5 | "upper-case": { 6 | "version": "1.1.3", 7 | "from": "upper-case@latest", 8 | "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz" 9 | }, 10 | "xml2js": { 11 | "version": "0.4.17", 12 | "from": "xml2js@latest", 13 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.17.tgz", 14 | "dependencies": { 15 | "sax": { 16 | "version": "1.2.2", 17 | "from": "sax@>=0.6.0", 18 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.2.tgz" 19 | }, 20 | "xmlbuilder": { 21 | "version": "4.2.1", 22 | "from": "xmlbuilder@>=4.1.0 <5.0.0", 23 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-4.2.1.tgz", 24 | "dependencies": { 25 | "lodash": { 26 | "version": "4.17.4", 27 | "from": "lodash@>=4.0.0 <5.0.0", 28 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" 29 | } 30 | } 31 | } 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/nuget/LDService_Output_0_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:nuget/NUnit/3_7_1": [], 4 | "http:nuget/NUnit_Extension_TeamCityEventListener/1_0_2": [], 5 | "http:nuget/EntityFramework/6_1_3": [], 6 | "http:nuget/NUnit_ConsoleRunner/3_6_1": [], 7 | "http:nuget/NUnit_Extension_NUnitProjectLoader/3_5_0": [] 8 | }, 9 | "dependencySummaries": { 10 | "http:nuget/NUnit/3_7_1": { 11 | "name": "NUnit", 12 | "version": "3.7.1" 13 | }, 14 | "http:nuget/NUnit_Extension_TeamCityEventListener/1_0_2": { 15 | "name": "NUnit.Extension.TeamCityEventListener", 16 | "version": "1.0.2" 17 | }, 18 | "http:nuget/EntityFramework/6_1_3": { 19 | "name": "EntityFramework", 20 | "version": "6.1.3" 21 | }, 22 | "http:nuget/NUnit_ConsoleRunner/3_6_1": { 23 | "name": "NUnit.ConsoleRunner", 24 | "version": "3.6.1" 25 | }, 26 | "http:nuget/NUnit_Extension_NUnitProjectLoader/3_5_0": { 27 | "name": "NUnit.Extension.NUnitProjectLoader", 28 | "version": "3.5.0" 29 | } 30 | }, 31 | "rootExternalDataIds": [ 32 | "http:nuget/NUnit/3_7_1", 33 | "http:nuget/NUnit_Extension_TeamCityEventListener/1_0_2", 34 | "http:nuget/EntityFramework/6_1_3", 35 | "http:nuget/NUnit_ConsoleRunner/3_6_1", 36 | "http:nuget/NUnit_Extension_NUnitProjectLoader/3_5_0" 37 | ] 38 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/nuget/LDService_Output_11_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:nuget/NUnit/3_7_1": [], 4 | "http:nuget/NUnit_Extension_TeamCityEventListener/1_0_2": [], 5 | "http:nuget/NUnit_ConsoleRunner/3_6_1": [], 6 | "http:nuget/NUnit_Extension_NUnitProjectLoader/3_5_0": [] 7 | }, 8 | "dependencySummaries": { 9 | "http:nuget/NUnit/3_7_1": { 10 | "name": "NUnit", 11 | "version": "3.7.1" 12 | }, 13 | "http:nuget/NUnit_Extension_TeamCityEventListener/1_0_2": { 14 | "name": "NUnit.Extension.TeamCityEventListener", 15 | "version": "1.0.2" 16 | }, 17 | "http:nuget/NUnit_ConsoleRunner/3_6_1": { 18 | "name": "NUnit.ConsoleRunner", 19 | "version": "3.6.1" 20 | }, 21 | "http:nuget/NUnit_Extension_NUnitProjectLoader/3_5_0": { 22 | "name": "NUnit.Extension.NUnitProjectLoader", 23 | "version": "3.5.0" 24 | } 25 | }, 26 | "rootExternalDataIds": [ 27 | "http:nuget/NUnit/3_7_1", 28 | "http:nuget/NUnit_Extension_TeamCityEventListener/1_0_2", 29 | "http:nuget/NUnit_ConsoleRunner/3_6_1", 30 | "http:nuget/NUnit_Extension_NUnitProjectLoader/3_5_0" 31 | ] 32 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/nuget/LDService_Output_12_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": {}, 3 | "dependencySummaries": {}, 4 | "rootExternalDataIds": [] 5 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/nuget/LDService_Output_2_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": {}, 3 | "dependencySummaries": {}, 4 | "rootExternalDataIds": [] 5 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/nuget/LDService_Output_6_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:nuget/EntityFramework/6_1_3": [], 4 | "http:nuget/NLog/4_4_11": [], 5 | "http:nuget/Newtonsoft_Json/10_0_3": [], 6 | "http:nuget/Ensure_That/5_0_0": [] 7 | }, 8 | "dependencySummaries": { 9 | "http:nuget/EntityFramework/6_1_3": { 10 | "name": "EntityFramework", 11 | "version": "6.1.3" 12 | }, 13 | "http:nuget/NLog/4_4_11": { 14 | "name": "NLog", 15 | "version": "4.4.11" 16 | }, 17 | "http:nuget/Newtonsoft_Json/10_0_3": { 18 | "name": "Newtonsoft.Json", 19 | "version": "10.0.3" 20 | }, 21 | "http:nuget/Ensure_That/5_0_0": { 22 | "name": "Ensure.That", 23 | "version": "5.0.0" 24 | } 25 | }, 26 | "rootExternalDataIds": [ 27 | "http:nuget/EntityFramework/6_1_3", 28 | "http:nuget/NLog/4_4_11", 29 | "http:nuget/Newtonsoft_Json/10_0_3", 30 | "http:nuget/Ensure_That/5_0_0" 31 | ] 32 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/nuget/LDService_Output_7_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": {}, 3 | "dependencySummaries": {}, 4 | "rootExternalDataIds": [] 5 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/nuget/LDService_Output_8_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": {}, 3 | "dependencySummaries": {}, 4 | "rootExternalDataIds": [] 5 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/nuget/LDService_Output_9_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": {}, 3 | "dependencySummaries": {}, 4 | "rootExternalDataIds": [] 5 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/packagist/PackagistTestDependencyNode_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:packagist/graphp_graphviz/v0_2_1": [ 4 | "http:packagist/clue_graph/v0_9_0", 5 | "http:packagist/graphp_algorithms/v0_8_1" 6 | ], 7 | "http:packagist/clue_graph/v0_9_0": [], 8 | "http:packagist/graphp_algorithms/v0_8_1": [ 9 | "http:packagist/clue_graph/v0_9_0" 10 | ], 11 | "http:packagist/symfony_console/v2_6_13": [], 12 | "http:packagist/jms_composer_deps_analyzer/0_1_0": [] 13 | }, 14 | "dependencySummaries": { 15 | "http:packagist/graphp_graphviz/v0_2_1": { 16 | "name": "graphp/graphviz", 17 | "version": "v0.2.1" 18 | }, 19 | "http:packagist/clue_graph/v0_9_0": { 20 | "name": "clue/graph", 21 | "version": "v0.9.0" 22 | }, 23 | "http:packagist/graphp_algorithms/v0_8_1": { 24 | "name": "graphp/algorithms", 25 | "version": "v0.8.1" 26 | }, 27 | "http:packagist/symfony_console/v2_6_13": { 28 | "name": "symfony/console", 29 | "version": "v2.6.13" 30 | }, 31 | "http:packagist/jms_composer_deps_analyzer/0_1_0": { 32 | "name": "jms/composer-deps-analyzer", 33 | "version": "0.1.0" 34 | } 35 | }, 36 | "rootExternalDataIds": [ 37 | "http:packagist/graphp_graphviz/v0_2_1", 38 | "http:packagist/clue_graph/v0_9_0", 39 | "http:packagist/symfony_console/v2_6_13", 40 | "http:packagist/jms_composer_deps_analyzer/0_1_0" 41 | ] 42 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/packagist/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clue/graph-composer", 3 | "version": "1.0.0", 4 | "description": "Dependency graph visualization for composer.json", 5 | "keywords": ["dependency graph", "visualize dependencies", "visualize composer"], 6 | "homepage": "https://github.com/clue/graph-composer", 7 | "license": "MIT", 8 | "require": { 9 | "php": "^5.3.6 || ^7.0", 10 | "clue/graph": "^0.9.0", 11 | "jms/composer-deps-analyzer": "0.1.*", 12 | "symfony/console": "^2.1 || ^3.0", 13 | "graphp/graphviz": "^0.2.0" 14 | }, 15 | "autoload": { 16 | "psr-0": { "Clue\\GraphComposer": "src/" } 17 | }, 18 | "bin": [ "bin/graph-composer" ], 19 | "extra": { 20 | "phar": { 21 | "bundler": "composer" 22 | } 23 | }, 24 | "config": { 25 | "platform": { 26 | "php": "5.3.6" 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/pear/dependencies-list.txt: -------------------------------------------------------------------------------- 1 | Dependencies for PEAR 2 | ===================== 3 | Required? Type Name Versioning Group 4 | Yes Php (version >= 5.4.0) 5 | Yes Pear Installer (version >= 1.9.0) 6 | Yes Package pear/Archive_Tar (recommended version 1.4.3) 7 | Yes Package pear/Structures_Graph (recommended version 1.1.1) 8 | Yes Package pear/Console_Getopt (recommended version 1.4.1) 9 | Yes Package pear/XML_Util (recommended version 1.4.2) 10 | Yes Package pear/PEAR_Frontend_Web conflicts 11 | Yes Package pear/PEAR_Frontend_Gtk conflicts 12 | Yes Extension xml 13 | Yes Extension pcre 14 | No Package pear/PEAR_Frontend_Web (version >= 0.5.1) 15 | No Package pear/PEAR_Frontend_Gtk (version >= 0.4.0) 16 | No Package pear/PEAR_Frontend_Gtk2 -------------------------------------------------------------------------------- /hub-detect/src/test/resources/pear/dependency-node-list.txt: -------------------------------------------------------------------------------- 1 | [{"name":"Archive_Tar","version":"1.4.3","externalId":{"name":"Archive_Tar","version":"1.4.3","forge":"pear"},"children":[]}, {"name":"Console_Getopt","version":"1.4.1","externalId":{"name":"Console_Getopt","version":"1.4.1","forge":"pear"},"children":[]}, {"name":"Structures_Graph","version":"1.1.1","externalId":{"name":"Structures_Graph","version":"1.1.1","forge":"pear"},"children":[]}] -------------------------------------------------------------------------------- /hub-detect/src/test/resources/pear/dependency-node-list_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:pear/Archive_Tar/1_4_3": [], 4 | "http:pear/Console_Getopt/1_4_1": [], 5 | "http:pear/Structures_Graph/1_1_1": [] 6 | }, 7 | "dependencySummaries": { 8 | "http:pear/Archive_Tar/1_4_3": { 9 | "name": "Archive_Tar", 10 | "version": "1.4.3" 11 | }, 12 | "http:pear/Console_Getopt/1_4_1": { 13 | "name": "Console_Getopt", 14 | "version": "1.4.1" 15 | }, 16 | "http:pear/Structures_Graph/1_1_1": { 17 | "name": "Structures_Graph", 18 | "version": "1.1.1" 19 | } 20 | }, 21 | "rootExternalDataIds": [ 22 | "http:pear/Archive_Tar/1_4_3", 23 | "http:pear/Console_Getopt/1_4_1", 24 | "http:pear/Structures_Graph/1_1_1" 25 | ] 26 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/pear/installed-packages.txt: -------------------------------------------------------------------------------- 1 | Installed packages, channel pear.php.net: 2 | ========================================= 3 | Package Version State 4 | Archive_Tar 1.4.3 stable 5 | Console_Getopt 1.4.1 stable 6 | HTML_Common 1.2.5 stable 7 | HTML_Page2 0.6.5 beta 8 | HTML_Template_IT 1.3.0 stable 9 | Net_DNS2 1.4.3 stable 10 | Net_UserAgent_Detect 2.5.2 stable 11 | PEAR 1.10.5 stable 12 | PEAR_Frontend_Web 0.5.2 alpha 13 | Structures_Graph 1.1.1 stable 14 | XML_Util 1.4.2 stable -------------------------------------------------------------------------------- /hub-detect/src/test/resources/rubygems/Gemfile-rails.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | nokogiri (1.8.2) 5 | mini_portile2 (~> 2.3.0) 6 | nokogiri (1.8.2-java) 7 | nokogiri (1.8.2-x64-mingw32) 8 | mini_portile2 (~> 2.3.0) 9 | nokogiri (1.8.2-x86-mingw32) 10 | mini_portile2 (~> 2.3.0) 11 | nokoparent (3.1.0) 12 | nokogiri (~> 1.8) 13 | 14 | PLATFORMS 15 | java 16 | ruby 17 | x64-mingw32 18 | x86-mingw32 19 | 20 | DEPENDENCIES 21 | nokoparent (>= 1) 22 | nokogiri (>= 1.8.1) 23 | 24 | BUNDLED WITH 25 | 1.16.2 26 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/rubygems/Gemfile_equals_version.lock: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2013-2018 Illumio, Inc. All Rights Reserved. 3 | # 4 | GEM 5 | remote: https://artifactory.ilabs.io/artifactory/api/gems/gem-public/ 6 | specs: 7 | SyslogLogger (2.0) 8 | activesupport (4.1.15) 9 | i18n (~> 0.6, >= 0.6.9) 10 | json (~> 1.7, >= 1.7.7) 11 | minitest (~> 5.1) 12 | thread_safe (~> 0.1) 13 | tzinfo (~> 1.1) 14 | addressable (2.3.8) 15 | curb (0.8.8) 16 | i18n (0.8.6) 17 | iseq (0.0.3.2) 18 | jmespath (1.3.1) 19 | json (1.8.6) 20 | json-schema (2.6.2) 21 | addressable (~> 2.3.8) 22 | macaddr (1.7.1) 23 | systemu (~> 2.6.2) 24 | minitest (5.10.3) 25 | net-ssh (4.2.0) 26 | net-ssh-telnet (0.0.2) 27 | net-ssh (>= 2.0.1) 28 | net_http_unix (0.2.2) 29 | pg (0.20.0) 30 | sequel (5.0.0) 31 | snmp (1.2.0) 32 | systemu (2.6.5) 33 | thread_safe (0.3.6) 34 | tzinfo (1.2.3) 35 | thread_safe (~> 0.1) 36 | uuid (2.3.8) 37 | macaddr (~> 1.0) 38 | 39 | PLATFORMS 40 | ruby 41 | 42 | DEPENDENCIES 43 | SyslogLogger (~> 2.0) 44 | activesupport (~> 4.1.15) 45 | bundler (= 1.11.2) 46 | curb (= 0.8.8) 47 | iseq (~> 0.0.3.2) 48 | json (~> 1.8.1) 49 | json-schema (~> 2.6.0) 50 | net-ssh-telnet (~> 0.0.2) 51 | net_http_unix (~> 0.2.2) 52 | pg (~> 0.20.0) 53 | snmp (~ 1.2) 54 | sequel (~> 5.0.0) 55 | uuid (~> 2.3) 56 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/yarn/list_expected_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:npm/async/0_9_2": [ 4 | "http:npm/minimist/0_0_8" 5 | ], 6 | "http:npm/minimist/0.0.8": [] 7 | }, 8 | "dependencySummaries": { 9 | "http:npm/minimist/0_0_8": { 10 | "name": "minimist", 11 | "version": "0.0.8" 12 | }, 13 | "http:npm/async/0_9_2": { 14 | "name": "async", 15 | "version": "0.9.2" 16 | } 17 | }, 18 | "rootExternalDataIds": [ 19 | "http:npm/async/0_9_2" 20 | ] 21 | } -------------------------------------------------------------------------------- /hub-detect/src/test/resources/yarn/list_expected_graph_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "externalDataIdRelationships": { 3 | "http:npm/co/4_6_0": [ 4 | "http:npm/hoek/4_2_1" 5 | ], 6 | "http:npm/ajv/5_5_2": [ 7 | "http:npm/co/4_6_0", 8 | "http:npm/tr46/0_0_3", 9 | "http:npm/cssstyle/0_2_37" 10 | ] 11 | }, 12 | "dependencySummaries": { 13 | "http:npm/ajv/5_5_2": { 14 | "name": "ajv", 15 | "version": "5.5.2" 16 | }, 17 | "http:npm/co/4_6_0": { 18 | "name": "co", 19 | "version": "4.6.0" 20 | }, 21 | "http:npm/tr46/0_0_3": { 22 | "name": "tr46", 23 | "version": "0.0.3" 24 | }, 25 | "http:npm/cssstyle/0_2_37": { 26 | "name": "cssstyle", 27 | "version": "0.2.37" 28 | }, 29 | "http:npm/hoek/4_2_1": { 30 | "name": "hoek", 31 | "version": "4.2.1" 32 | } 33 | }, 34 | "rootExternalDataIds": [ 35 | "http:npm/ajv/5_5_2" 36 | ] 37 | } 38 | 39 | -------------------------------------------------------------------------------- /hub-detect/src/test/resources/yarn/yarn.list.res.txt: -------------------------------------------------------------------------------- 1 | ├─ ajv@5.5.2 2 | │ ├─ co@^4.6.0 3 | │ │ └─ hoek@4.x.x 4 | │ ├─ tr46@~0.0.3 5 | │ └─ cssstyle@>= 0.2.37 < 0.3.0 -------------------------------------------------------------------------------- /hub-detect/src/test/resources/yarn/yarn.list.txt: -------------------------------------------------------------------------------- 1 | ├─ async@~0.9.0 2 | │ ├─ minimist@0.0.8 -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include "hub-detect" 2 | include "detect-configuration" 3 | 4 | rootProject.name = 'detect' 5 | rootProject.children.each { 6 | project -> project.buildFileName = "${project.name}.gradle" 7 | } 8 | --------------------------------------------------------------------------------