提交 67f3cd6c 编写于 作者: S Serge Rider

Ignore broken drivers in maven

上级 2f81b58d
......@@ -97,11 +97,21 @@ public class MavenArtifact implements IMavenIdentifier
log.warn("Error parsing artifact directory", e);
}
} finally {
removeIgnoredVersions();
monitor.worked(1);
}
metadataLoaded = true;
}
private void removeIgnoredVersions() {
for (Iterator<String> iter = versions.iterator(); iter.hasNext(); ) {
String version = iter.next();
if (MavenRegistry.getInstance().isVersionIgnored(groupId + ":" + artifactId + ":" + version)) {
iter.remove();
}
}
}
private void parseDirectory(InputStream dirStream) throws IOException, XMLException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
IOUtils.copyStream(dirStream, baos);
......
......@@ -39,6 +39,7 @@ public class MavenRegistry
public static final String MAVEN_LOCAL_REPO_FOLDER = "maven-local";
private static MavenRegistry instance = null;
private final Set<String> ignoredArtifactVersions = new HashSet<>();
public synchronized static MavenRegistry getInstance()
{
......@@ -58,6 +59,10 @@ public class MavenRegistry
{
}
boolean isVersionIgnored(String ref) {
return ignoredArtifactVersions.contains(ref);
}
private void init() {
loadStandardRepositories();
loadCustomRepositories();
......@@ -68,8 +73,12 @@ public class MavenRegistry
{
IConfigurationElement[] extElements = Platform.getExtensionRegistry().getConfigurationElementsFor(MavenRepository.EXTENSION_ID);
for (IConfigurationElement ext : extElements) {
MavenRepository repository = new MavenRepository(ext);
repositories.add(repository);
if ("repository".equals(ext.getName())) {
MavenRepository repository = new MavenRepository(ext);
repositories.add(repository);
} else if ("ignoreArtifactVersion".equals(ext.getName())) {
ignoredArtifactVersions.add(ext.getAttribute("id"));
}
}
}
// Create local repository
......
......@@ -371,4 +371,10 @@
</handler>
</extension>
<!-- Exclude broken driver versions -->
<extension point="org.jkiss.dbeaver.mavenRepository">
<ignoreArtifactVersion id="mysql:mysql-connector-java:6.0.2"/>
<ignoreArtifactVersion id="org.mariadb.jdbc:mariadb-java-client:1.4.0"/>
</extension>
</plugin>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册