in tooling/camel-karaf-maven-plugin/src/main/java/org/apache/camel/maven/KarafRunMojo.java [818:855]
private Set<Artifact> determineRelevantPluginDependencies() throws MojoExecutionException {
Set<Artifact> relevantDependencies;
if (this.includePluginDependencies) {
if (this.executableDependency == null) {
getLog().debug("All Plugin Dependencies will be included.");
relevantDependencies = new HashSet<>(this.pluginDependencies);
} else {
getLog().debug("Selected plugin Dependencies will be included.");
Artifact executableArtifact = this.findExecutableArtifact();
Artifact executablePomArtifact = this.getExecutablePomArtifact(executableArtifact);
relevantDependencies = this.resolveExecutableDependencies(executablePomArtifact, false);
}
} else {
getLog().debug("Only Direct Plugin Dependencies will be included.");
PluginDescriptor descriptor = (PluginDescriptor) getPluginContext().get("pluginDescriptor");
try {
relevantDependencies = artifactResolver
.resolveTransitively(MavenMetadataSource
.createArtifacts(this.artifactFactory,
descriptor.getPlugin().getDependencies(),
null, null, null),
this.project.getArtifact(),
Collections.emptyMap(),
this.localRepository,
this.remoteRepositories,
metadataSource,
new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME),
Collections.emptyList())
.getArtifacts();
} catch (Exception ex) {
throw new MojoExecutionException(
"Encountered problems resolving dependencies of the plugin "
+ "in preparation for its execution.",
ex);
}
}
return relevantDependencies;
}