}
@Override
public void removeManagedDependency(final Dependency manDep)
{
MavenCoreFacet maven = project.getFacet(MavenCoreFacet.class);
Model pom = maven.getPOM();
DependencyManagement depMan = pom.getDependencyManagement();
depMan = depMan != null ? depMan : new DependencyManagement();
List<Dependency> managedDependencies = MavenDependencyAdapter.fromMavenList(depMan.getDependencies());
List<Dependency> toBeRemoved = new ArrayList<Dependency>();
for (Dependency managedDependency : managedDependencies)
{
if (DependencyBuilder.areEquivalent(managedDependency, manDep))
{
toBeRemoved.add(managedDependency);
}
}
managedDependencies.removeAll(toBeRemoved);
depMan.setDependencies(MavenDependencyAdapter.toMavenList(managedDependencies));
pom.setDependencyManagement(depMan);
maven.setPOM(pom);
}