IDEA-109943 Download Library from Maven Repository: artifacts from repository with provider != maven2 are suggested, but repository is filtered off

This commit is contained in:
Gregory.Shrago
2013-09-25 23:31:55 +04:00
parent d4bc48decb
commit 4e10a17aef
4 changed files with 19 additions and 3 deletions
@@ -95,6 +95,7 @@ public class MavenArtifactInfo implements Serializable {
MavenId.append(builder, myPackaging);
if (!StringUtil.isEmptyOrSpaces(myClassifier)) MavenId.append(builder, myClassifier);
MavenId.append(builder, myVersion);
MavenId.append(builder, myRepositoryId);
return builder.toString();
}
@@ -39,4 +39,15 @@ public class MavenRepositoryInfo implements Serializable {
public String getUrl() {
return myUrl;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
MavenId.append(builder, myId);
MavenId.append(builder, myName);
MavenId.append(builder, myUrl);
return builder.toString();
}
}
@@ -90,8 +90,8 @@ public class RepositoryAttachDialog extends DialogWrapper {
myProject = project;
myProgressIcon.suspend();
myCaptionLabel.setText(
XmlStringUtil.wrapInHtml(StringUtil.escapeXml("enter keyword, pattern or class name to search by or Maven coordinates," +
"i.e. 'springframework', 'Logger' or 'org.hibernate:hibernate-core:3.5.0.GA':")
XmlStringUtil.wrapInHtml(StringUtil.escapeXml("keyword or class name to search by or exact Maven coordinates, " +
"i.e. 'spring', 'Logger' or 'ant:ant-junit:1.6.5'")
));
myInfoLabel.setPreferredSize(
new Dimension(myInfoLabel.getFontMetrics(myInfoLabel.getFont()).stringWidth("Showing: 1000"), myInfoLabel.getPreferredSize().height));
@@ -222,7 +222,11 @@ public class RepositoryAttachHandler {
tooManyResults = true;
}
else {
resultList.add(Pair.create(artifact, map.get(artifact.getRepositoryId())));
MavenRepositoryInfo repository = map.get(artifact.getRepositoryId());
// if the artifact is provided by an unsupported repository just skip it
// because it won't be resolved anyway
if (repository == null) continue;
resultList.add(Pair.create(artifact, repository));
}
}
}