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 =
core.get(pluginDep.getArtifact().getGroupId() + ":"
+ pluginDep.getArtifact().getArtifactId());
if (managedDep != null
&& !Objects.equals(
pluginDep.getArtifact().getVersion(),
managedDep.getArtifact().getVersion())) {
pluginDep = pluginDep.setArtifact(pluginDep
.getArtifact()
.setVersion(managedDep.getArtifact().getVersion()));
pluginDep = pluginDep.setScope(DependencyScope.PROVIDED.id());
if (managedDep != null) {
// align version if needed
if (!Objects.equals(
pluginDep.getArtifact().getVersion(),
managedDep.getArtifact().getVersion())) {
pluginDep = pluginDep.setArtifact(pluginDep
.getArtifact()
.setVersion(managedDep.getArtifact().getVersion()));
}
// align scope
pluginDep = pluginDep.setScope(managedDep.getScope());
}
request.addDependency(pluginDep);
}