Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
234bb652
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
234bb652
编写于
10月 09, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Dependency exclusions
上级
4734642d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
73 addition
and
39 deletion
+73
-39
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryAbstract.java
.../jkiss/dbeaver/registry/driver/DriverLibraryAbstract.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryLocal.java
...org/jkiss/dbeaver/registry/driver/DriverLibraryLocal.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryMavenArtifact.java
...s/dbeaver/registry/driver/DriverLibraryMavenArtifact.java
+41
-14
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryMavenDependency.java
...dbeaver/registry/driver/DriverLibraryMavenDependency.java
+2
-17
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactDependency.java
...jkiss/dbeaver/registry/maven/MavenArtifactDependency.java
+4
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactVersion.java
...rg/jkiss/dbeaver/registry/maven/MavenArtifactVersion.java
+9
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRepository.java
...src/org/jkiss/dbeaver/registry/maven/MavenRepository.java
+9
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
...iss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
+4
-4
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBPDriverLibrary.java
...r.model/src/org/jkiss/dbeaver/model/DBPDriverLibrary.java
+2
-2
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryAbstract.java
浏览文件 @
234bb652
...
...
@@ -152,7 +152,7 @@ public abstract class DriverLibraryAbstract implements DBPDriverLibrary
return
system
==
null
||
system
.
matches
(
DBeaverCore
.
getInstance
().
getLocalSystem
());
}
public
void
downloadLibraryFile
(
DBRProgressMonitor
monitor
,
boolean
forceUpdate
)
throws
IOException
,
InterruptedException
public
void
downloadLibraryFile
(
@NotNull
DBRProgressMonitor
monitor
,
boolean
forceUpdate
)
throws
IOException
,
InterruptedException
{
String
externalURL
=
getExternalURL
();
if
(
externalURL
==
null
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryLocal.java
浏览文件 @
234bb652
...
...
@@ -130,7 +130,7 @@ public class DriverLibraryLocal extends DriverLibraryAbstract
@Nullable
@Override
public
Collection
<
DBPDriverLibrary
>
getDependencies
(
DBRProgressMonitor
monitor
)
throws
IOException
{
public
Collection
<
DBPDriverLibrary
>
getDependencies
(
@NotNull
DBRProgressMonitor
monitor
,
DBPDriverLibrary
ownerLibrary
)
throws
IOException
{
return
null
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryMavenArtifact.java
浏览文件 @
234bb652
...
...
@@ -74,14 +74,20 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
}
@Nullable
@Override
public
String
getExternalURL
()
{
protected
MavenLocalVersion
getMavenLocalVersion
()
{
MavenArtifact
artifact
=
getMavenArtifact
();
if
(
artifact
!=
null
)
{
MavenLocalVersion
localVersion
=
artifact
.
getActiveLocalVersion
();
if
(
localVersion
!=
null
)
{
return
localVersion
.
getExternalURL
(
MavenArtifact
.
FILE_JAR
);
}
return
artifact
.
getActiveLocalVersion
();
}
return
null
;
}
@Nullable
@Override
public
String
getExternalURL
()
{
MavenLocalVersion
localVersion
=
getMavenLocalVersion
();
if
(
localVersion
!=
null
)
{
return
localVersion
.
getExternalURL
(
MavenArtifact
.
FILE_JAR
);
}
return
null
;
}
...
...
@@ -124,15 +130,38 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
@Nullable
@Override
public
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
DBRProgressMonitor
monitor
)
throws
IOException
{
public
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
@NotNull
DBRProgressMonitor
monitor
,
DBPDriverLibrary
ownerLibrary
)
throws
IOException
{
List
<
DriverLibraryMavenDependency
>
dependencies
=
new
ArrayList
<>();
List
<
MavenArtifactReference
>
exclusions
=
null
;
MavenLocalVersion
localVersion
=
resolveLocalVersion
(
monitor
,
false
);
if
(
localVersion
!=
null
)
{
// Find owner's exclusions
if
(
ownerLibrary
instanceof
DriverLibraryMavenArtifact
)
{
MavenLocalVersion
ownerVersion
=
((
DriverLibraryMavenArtifact
)
ownerLibrary
).
getMavenLocalVersion
();
if
(
ownerVersion
!=
null
)
{
exclusions
=
ownerVersion
.
getMetaData
(
monitor
)
.
findExclusionsFor
(
localVersion
.
getArtifact
().
getGroupId
(),
localVersion
.
getArtifact
().
getArtifactId
());
}
}
MavenArtifactVersion
metaData
=
localVersion
.
getMetaData
(
monitor
);
List
<
MavenArtifactDependency
>
artifactDeps
=
metaData
.
getDependencies
(
monitor
);
if
(!
CommonUtils
.
isEmpty
(
artifactDeps
))
{
for
(
MavenArtifactDependency
artifactDep
:
artifactDeps
)
{
boolean
excluded
=
false
;
if
(
exclusions
!=
null
)
{
for
(
MavenArtifactReference
ex
:
exclusions
)
{
if
(
ex
.
getGroupId
().
equals
(
artifactDep
.
getGroupId
())
&&
ex
.
getArtifactId
().
equals
(
artifactDep
.
getArtifactId
()))
{
excluded
=
true
;
break
;
}
}
if
(
excluded
)
{
// Excluded
continue
;
}
}
MavenLocalVersion
depLocalVersion
=
artifactDep
.
resolveDependency
(
monitor
);
if
(
depLocalVersion
!=
null
)
{
dependencies
.
add
(
...
...
@@ -157,13 +186,11 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
@Override
public
String
getVersion
()
{
MavenArtifact
artifact
=
getMavenArtifact
();
if
(
artifact
!=
null
)
{
MavenLocalVersion
version
=
artifact
.
getActiveLocalVersion
();
if
(
version
!=
null
)
{
return
version
.
getVersion
();
}
MavenLocalVersion
version
=
getMavenLocalVersion
();
if
(
version
!=
null
)
{
return
version
.
getVersion
();
}
return
path
;
}
...
...
@@ -173,7 +200,7 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
return
UIIcon
.
APACHE
;
}
public
void
downloadLibraryFile
(
DBRProgressMonitor
monitor
,
boolean
forceUpdate
)
throws
IOException
,
InterruptedException
{
public
void
downloadLibraryFile
(
@NotNull
DBRProgressMonitor
monitor
,
boolean
forceUpdate
)
throws
IOException
,
InterruptedException
{
MavenLocalVersion
localVersion
=
resolveLocalVersion
(
monitor
,
forceUpdate
);
if
(
localVersion
.
getArtifact
().
getRepository
().
isLocal
())
{
// No need to download local artifacts
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverLibraryMavenDependency.java
浏览文件 @
234bb652
...
...
@@ -43,18 +43,12 @@ public class DriverLibraryMavenDependency extends DriverLibraryMavenArtifact
return
true
;
}
@Nullable
private
MavenArtifact
getMavenArtifact
()
{
return
localVersion
.
getArtifact
();
}
@Nullable
@Override
p
ublic
String
getExternalURL
()
{
return
localVersion
.
getExternalURL
(
MavenArtifact
.
FILE_JAR
)
;
p
rotected
MavenLocalVersion
getMavenLocalVersion
()
{
return
localVersion
;
}
@Nullable
@Override
public
File
getLocalFile
()
...
...
@@ -62,15 +56,6 @@ public class DriverLibraryMavenDependency extends DriverLibraryMavenArtifact
return
localVersion
.
getCacheFile
();
}
@NotNull
public
String
getDisplayName
()
{
return
localVersion
.
getArtifact
().
getGroupId
()
+
":"
+
localVersion
.
getArtifact
().
getArtifactId
();
}
public
String
getVersion
()
{
return
localVersion
.
getVersion
();
}
protected
MavenLocalVersion
resolveLocalVersion
(
DBRProgressMonitor
monitor
,
boolean
forceUpdate
)
throws
IOException
{
return
localVersion
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactDependency.java
浏览文件 @
234bb652
...
...
@@ -21,6 +21,7 @@ import org.jkiss.code.NotNull;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -68,6 +69,9 @@ public class MavenArtifactDependency extends MavenArtifactReference {
}
void
addExclusion
(
MavenArtifactReference
ref
)
{
if
(
exclusions
==
null
)
{
exclusions
=
new
ArrayList
<>();
}
exclusions
.
add
(
ref
);
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactVersion.java
浏览文件 @
234bb652
...
...
@@ -141,6 +141,15 @@ public class MavenArtifactVersion {
return
this
.
dependencies
;
}
public
List
<
MavenArtifactReference
>
findExclusionsFor
(
String
groupId
,
String
artifactId
)
{
for
(
MavenArtifactDependency
dependency
:
dependencies
)
{
if
(
dependency
.
getGroupId
().
equals
(
groupId
)
&&
dependency
.
getArtifactId
().
equals
(
artifactId
))
{
return
dependency
.
getExclusions
();
}
}
return
null
;
}
List
<
MavenArtifactDependency
>
getDependencies
()
{
return
dependencies
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenRepository.java
浏览文件 @
234bb652
...
...
@@ -53,6 +53,7 @@ public class MavenRepository
public
static
final
String
TAG_ARTIFACT
=
"artifact"
;
public
static
final
String
TAG_VERSION
=
"version"
;
public
static
final
String
TAG_DEPENDENCY
=
"dependency"
;
public
static
final
String
TAG_EXCLUDE
=
"exclude"
;
public
static
final
String
ATTR_NAME
=
"name"
;
public
static
final
String
ATTR_URL
=
"url"
;
...
...
@@ -367,6 +368,14 @@ public class MavenRepository
if
(
dependency
.
isOptional
())
{
xml
.
addAttribute
(
ATTR_OPTIONAL
,
true
);
}
List
<
MavenArtifactReference
>
exclusions
=
dependency
.
getExclusions
();
if
(
exclusions
!=
null
)
{
for
(
MavenArtifactReference
ex
:
exclusions
)
{
try
(
XMLBuilder
.
Element
e4
=
xml
.
startElement
(
TAG_EXCLUDE
))
{
xml
.
addAttribute
(
ATTR_PATH
,
ex
.
getPath
());
}
}
}
}
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
浏览文件 @
234bb652
...
...
@@ -96,7 +96,7 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
monitor
.
beginTask
(
"Resolve dependencies"
,
100
);
try
{
for
(
DBPDriverLibrary
library
:
getWizard
().
getFiles
())
{
resolveDependencies
(
monitor
,
library
,
depMap
);
resolveDependencies
(
monitor
,
library
,
null
,
depMap
);
}
}
catch
(
IOException
e
)
{
throw
new
InvocationTargetException
(
e
);
...
...
@@ -134,7 +134,7 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
shell
.
layout
();
}
private
void
resolveDependencies
(
DBRProgressMonitor
monitor
,
DBPDriverLibrary
library
,
Map
<
String
,
List
<
DBPDriverLibrary
>>
depMap
)
throws
IOException
{
private
void
resolveDependencies
(
DBRProgressMonitor
monitor
,
DBPDriverLibrary
library
,
DBPDriverLibrary
ownerLibrary
,
Map
<
String
,
List
<
DBPDriverLibrary
>>
depMap
)
throws
IOException
{
String
libraryPath
=
library
.
getPath
();
List
<
DBPDriverLibrary
>
deps
=
depMap
.
get
(
libraryPath
);
if
(
deps
!=
null
)
{
...
...
@@ -144,11 +144,11 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
deps
=
new
ArrayList
<>();
depMap
.
put
(
libraryPath
,
deps
);
Collection
<?
extends
DBPDriverLibrary
>
dependencies
=
library
.
getDependencies
(
monitor
);
Collection
<?
extends
DBPDriverLibrary
>
dependencies
=
library
.
getDependencies
(
monitor
,
ownerLibrary
);
if
(
dependencies
!=
null
&&
!
dependencies
.
isEmpty
())
{
for
(
DBPDriverLibrary
dep
:
dependencies
)
{
deps
.
add
(
dep
);
resolveDependencies
(
monitor
,
dep
,
depMap
);
resolveDependencies
(
monitor
,
dep
,
library
,
depMap
);
}
}
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBPDriverLibrary.java
浏览文件 @
234bb652
...
...
@@ -83,8 +83,8 @@ public interface DBPDriverLibrary
boolean
matchesCurrentPlatform
();
@Nullable
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
DBRProgressMonitor
monitor
)
throws
IOException
;
Collection
<?
extends
DBPDriverLibrary
>
getDependencies
(
@NotNull
DBRProgressMonitor
monitor
,
@Nullable
DBPDriverLibrary
ownerLibrary
)
throws
IOException
;
void
downloadLibraryFile
(
DBRProgressMonitor
monitor
,
boolean
forceUpdate
)
void
downloadLibraryFile
(
@NotNull
DBRProgressMonitor
monitor
,
boolean
forceUpdate
)
throws
IOException
,
InterruptedException
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录