Add Require-Bundle dependency checking to DependencyCheckMojo#5816
Add Require-Bundle dependency checking to DependencyCheckMojo#5816
Conversation
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
| checkImportPackage(genericInfo, units, usages, analyzeCache, dependencyProblems, dependencyAnalyzer, | ||
| classResolver, lowestPackageVersion, allPackageVersion, packageWithError, log); | ||
| } else if (BundleNamespace.BUNDLE_NAMESPACE.equals(genericInfo.getNamespace())) { | ||
| checkRequireBundle(genericInfo, units, usages, analyzeCache, dependencyProblems, dependencyAnalyzer, | ||
| classResolver, lowestBundleVersion, allBundleVersion, bundleWithError, log); |
There was a problem hiding this comment.
@copilot The number of method arguments are quite high and hard to understand can we possibly use records to group related information? Possibly even extract the code in an own class e.g. assume we have a ImportPackageChecker and an RequireBundleChecker, these can hold the lowest/all/error collections and we pass static inforation in their constructors, then move the coresponding check method there so we can incrementally update and read only the final results at the end.
There was a problem hiding this comment.
Refactored in 75e34e7. Created:
DependencyCheckerbase class withCheckContextrecord to hold shared stateImportPackageCheckerfor Import-Package checkingRequireBundleCheckerfor Require-Bundle checking
The checkers hold their own state (lowestVersion, allVersions, withError collections) and expose results via getters. The mojo now creates instances with a shared context and reads final results from them.
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
DependencyCheckMojocode structureArtifactVersionProvider,ArtifactMatcherArtifactVersionProviderinterface withgetBundleVersionsmethodgetBundleVersionsinMavenArtifactVersionProvidergetBundleVersionsinEclipseIndexArtifactVersionProviderfindBundlemethod toArtifactMatcherDependencyCheckMojoto use checker classes (per review feedback)DependencyCheckerbase class withCheckContextrecordImportPackageCheckerfor Import-Package checkingRequireBundleCheckerfor Require-Bundle checkingDependencyCheckMojoto use checker classesOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.