Skip to content

Commit

Permalink
Merge 8bc9624 into e01aa63
Browse files Browse the repository at this point in the history
  • Loading branch information
DirkMahler authored Dec 11, 2024
2 parents e01aa63 + 8bc9624 commit 928a595
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public List<File> resolve(List<Plugin> plugins) {

private List<Dependency> getDependencies(List<Plugin> plugins) {
return plugins.stream()
.flatMap(plugin -> getPluginDependencies(plugin).stream())
.map(this::toDependency)
.collect(toList());
}

Expand All @@ -60,21 +60,15 @@ private DependencyResult resolvePlugins(List<Dependency> dependencies) {
return dependencyResult;
}

private List<Dependency> getPluginDependencies(Plugin plugin) {
List<Exclusion> exlusions = plugin.exclusions()
private Dependency toDependency(Plugin plugin) {
List<Exclusion> exclusions = plugin.exclusions()
.stream()
.map(AetherArtifactProvider::getPluginExclusions)
.flatMap(Collection::stream)
.collect(toList());
return plugin.artifactId()
.stream()
.map(artifactId -> getDependency(plugin, artifactId.trim(), exlusions))
.collect(toList());
}

private static Dependency getDependency(Plugin plugin, String artifactId, List<Exclusion> exlusions) {
return new Dependency(new DefaultArtifact(plugin.groupId(), artifactId, plugin.classifier()
.orElse(null), plugin.type(), plugin.version()), JavaScopes.RUNTIME, false, exlusions);
return new Dependency(new DefaultArtifact(plugin.groupId(), plugin.artifactId()
.trim(), plugin.classifier()
.orElse(null), plugin.type(), plugin.version()), JavaScopes.RUNTIME, false, exclusions);
}

private static List<Exclusion> getPluginExclusions(com.buschmais.jqassistant.core.shared.aether.configuration.Exclusion exclusion) {
Expand All @@ -99,9 +93,7 @@ private DependencyResult resolveDependencies(DependencyFilter classpathFilter, L

private void logDependencyTree(DependencyNode node, int indent) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < indent; i++) {
builder.append(' ');
}
builder.append(" ".repeat(indent));
Artifact artifact = node.getArtifact();
if (artifact != null) {
log.info("{}{}", builder, artifact);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface Plugin {
Optional<String> classifier();

@Description("The artifactId of the plugin.")
List<String> artifactId();
String artifactId();

@Description("The type (extension) of the plugin.")
@WithDefault("jar")
Expand Down

0 comments on commit 928a595

Please sign in to comment.