use of org.jetbrains.idea.maven.dom.model.MavenDomDependency in project intellij-community by JetBrains.
the class MavenNavigationUtil method findDependency.
@Nullable
public static MavenDomDependency findDependency(@NotNull MavenDomProjectModel projectDom, final String groupId, final String artifactId) {
MavenDomProjectProcessorUtils.SearchProcessor<MavenDomDependency, MavenDomDependencies> processor = new MavenDomProjectProcessorUtils.SearchProcessor<MavenDomDependency, MavenDomDependencies>() {
@Nullable
@Override
protected MavenDomDependency find(MavenDomDependencies element) {
for (MavenDomDependency dependency : element.getDependencies()) {
if (Comparing.equal(groupId, dependency.getGroupId().getStringValue()) && Comparing.equal(artifactId, dependency.getArtifactId().getStringValue())) {
return dependency;
}
}
return null;
}
};
MavenDomProjectProcessorUtils.processDependencies(projectDom, processor);
return processor.getResult();
}
use of org.jetbrains.idea.maven.dom.model.MavenDomDependency in project intellij-community by JetBrains.
the class MavenArtifactSearchDialog method setManagedDependencies.
public void setManagedDependencies(Collection<MavenDomDependency> managedDependencies) {
myManagedDependenciesMap.clear();
for (MavenDomDependency dependency : managedDependencies) {
String groupId = dependency.getGroupId().getStringValue();
String artifactId = dependency.getArtifactId().getStringValue();
String version = dependency.getVersion().getStringValue();
if (StringUtil.isNotEmpty(groupId) && StringUtil.isNotEmpty(artifactId) && StringUtil.isNotEmpty(version)) {
myManagedDependenciesMap.put(Pair.create(groupId, artifactId), version);
}
}
}
Aggregations