Extract method for debug logging package sets.
@@ -111,12 +111,7 @@ public class GenerateOsgiManifestMojo extends AbstractMojo {
warnIfPackagesDefinedOverlapsGlobalPackages(includedPackages.definedPackages(), publicPackagesFromProvidedJars.globals);
- if (getLog().isDebugEnabled()) {
- getLog().debug("Referenced packages = " + includedPackages.referencedPackages());
- getLog().debug("Defined packages = " + includedPackages.definedPackages());
- getLog().debug("Exported packages of dependencies = " + publicPackagesFromProvidedJars.exports.stream()
- .map(e -> "(" + e.getPackageNames().toString() + ", " + e.version().orElse("")).collect(Collectors.joining(", ")));
- }
+ logDebugPackageSets(publicPackagesFromProvidedJars, includedPackages);
if (hasJdiscCoreProvided(artifactSet.getJarArtifactsProvided())) {
// If jdisc_core is not provided, log output may contain packages that _are_ available runtime.
@@ -143,6 +138,15 @@ public class GenerateOsgiManifestMojo extends AbstractMojo {
}
}
+ private void logDebugPackageSets(AnalyzeBundle.PublicPackages publicPackagesFromProvidedJars, PackageTally includedPackages) {
+ if (getLog().isDebugEnabled()) {
+ getLog().debug("Referenced packages = " + includedPackages.referencedPackages());
+ getLog().debug("Defined packages = " + includedPackages.definedPackages());
+ getLog().debug("Exported packages of dependencies = " + publicPackagesFromProvidedJars.exports.stream()
+ .map(e -> "(" + e.getPackageNames().toString() + ", " + e.version().orElse("")).collect(Collectors.joining(", ")));
+ }
+ }
+
private boolean hasJdiscCoreProvided(List<Artifact> providedArtifacts) {
return providedArtifacts.stream().anyMatch(artifact -> artifact.getArtifactId().equals("jdisc_core"));
}
