Split the two

This commit is contained in:
Tamas Cservenak 2024-12-19 15:08:56 +01:00
parent f469391ee2
commit c3007ad151
1 changed files with 11 additions and 8 deletions

View File

@ -232,14 +232,17 @@ public class DefaultPluginDependenciesResolver implements PluginDependenciesReso
org.eclipse.aether.graph.Dependency managedDep = org.eclipse.aether.graph.Dependency managedDep =
core.get(pluginDep.getArtifact().getGroupId() + ":" core.get(pluginDep.getArtifact().getGroupId() + ":"
+ pluginDep.getArtifact().getArtifactId()); + pluginDep.getArtifact().getArtifactId());
if (managedDep != null if (managedDep != null) {
&& !Objects.equals( // align version if needed
pluginDep.getArtifact().getVersion(), if (!Objects.equals(
managedDep.getArtifact().getVersion())) { pluginDep.getArtifact().getVersion(),
pluginDep = pluginDep.setArtifact(pluginDep managedDep.getArtifact().getVersion())) {
.getArtifact() pluginDep = pluginDep.setArtifact(pluginDep
.setVersion(managedDep.getArtifact().getVersion())); .getArtifact()
pluginDep = pluginDep.setScope(DependencyScope.PROVIDED.id()); .setVersion(managedDep.getArtifact().getVersion()));
}
// align scope
pluginDep = pluginDep.setScope(managedDep.getScope());
} }
request.addDependency(pluginDep); request.addDependency(pluginDep);
} }