Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
9caa840f
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,发现更多精彩内容 >>
提交
9caa840f
编写于
3月 03, 2019
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Maven artifacts resolve fix (trim identifiers)
上级
38930ae8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
17 deletion
+20
-17
bundles/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
bundles/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
+3
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifact.java
...e/src/org/jkiss/dbeaver/registry/maven/MavenArtifact.java
+3
-4
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactReference.java
.../jkiss/dbeaver/registry/maven/MavenArtifactReference.java
+5
-4
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactVersion.java
...rg/jkiss/dbeaver/registry/maven/MavenArtifactVersion.java
+9
-9
未找到文件。
bundles/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
浏览文件 @
9caa840f
...
...
@@ -661,4 +661,7 @@ public class CommonUtils {
return
String
.
valueOf
(
val
);
}
public
static
String
trim
(
String
str
)
{
return
str
==
null
?
null
:
str
.
trim
();
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifact.java
浏览文件 @
9caa840f
...
...
@@ -70,9 +70,9 @@ public class MavenArtifact implements IMavenIdentifier
public
MavenArtifact
(
@NotNull
MavenRepository
repository
,
@NotNull
String
groupId
,
@NotNull
String
artifactId
,
@Nullable
String
classifier
)
{
this
.
repository
=
repository
;
this
.
groupId
=
groupId
;
this
.
artifactId
=
artifactId
;
this
.
classifier
=
classifier
;
this
.
groupId
=
CommonUtils
.
trim
(
groupId
)
;
this
.
artifactId
=
CommonUtils
.
trim
(
artifactId
)
;
this
.
classifier
=
CommonUtils
.
trim
(
classifier
)
;
}
public
void
loadMetadata
(
DBRProgressMonitor
monitor
)
throws
IOException
{
...
...
@@ -141,7 +141,6 @@ public class MavenArtifact implements IMavenIdentifier
@Override
public
void
saxStartElement
(
SAXReader
reader
,
String
namespaceURI
,
String
localName
,
Attributes
atts
)
throws
XMLException
{
lastTag
=
localName
;
}
@Override
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactReference.java
浏览文件 @
9caa840f
...
...
@@ -18,6 +18,7 @@ package org.jkiss.dbeaver.registry.maven;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.utils.CommonUtils
;
/**
* Maven artifact reference
...
...
@@ -42,10 +43,10 @@ public class MavenArtifactReference implements IMavenIdentifier
private
final
String
classifier
;
public
MavenArtifactReference
(
@NotNull
String
groupId
,
@NotNull
String
artifactId
,
@Nullable
String
classifier
,
@NotNull
String
version
)
{
this
.
groupId
=
groupId
;
this
.
artifactId
=
artifactId
;
this
.
version
=
version
;
this
.
classifier
=
classifier
;
this
.
groupId
=
CommonUtils
.
trim
(
groupId
)
;
this
.
artifactId
=
CommonUtils
.
trim
(
artifactId
)
;
this
.
version
=
CommonUtils
.
trim
(
version
)
;
this
.
classifier
=
CommonUtils
.
trim
(
classifier
)
;
this
.
id
=
makeId
(
this
);
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/maven/MavenArtifactVersion.java
浏览文件 @
9caa840f
...
...
@@ -88,7 +88,7 @@ public class MavenArtifactVersion implements IMavenIdentifier {
MavenArtifactVersion
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
MavenArtifact
artifact
,
@NotNull
String
version
)
throws
IOException
{
this
.
artifact
=
artifact
;
this
.
version
=
version
;
this
.
version
=
CommonUtils
.
trim
(
version
)
;
loadPOM
(
monitor
);
}
...
...
@@ -250,11 +250,11 @@ public class MavenArtifactVersion implements IMavenIdentifier {
throw
new
IOException
(
"Error parsing POM"
,
e
);
}
Element
root
=
pomDocument
.
getDocumentElement
();
name
=
XMLUtils
.
getChildElementBody
(
root
,
"name"
);
url
=
XMLUtils
.
getChildElementBody
(
root
,
"url"
);
version
=
XMLUtils
.
getChildElementBody
(
root
,
"version"
);
packaging
=
XMLUtils
.
getChildElementBody
(
root
,
"packaging"
);
description
=
XMLUtils
.
getChildElementBody
(
root
,
"description"
);
name
=
CommonUtils
.
trim
(
XMLUtils
.
getChildElementBody
(
root
,
"name"
)
);
url
=
CommonUtils
.
trim
(
XMLUtils
.
getChildElementBody
(
root
,
"url"
)
);
version
=
CommonUtils
.
trim
(
XMLUtils
.
getChildElementBody
(
root
,
"version"
)
);
packaging
=
CommonUtils
.
trim
(
XMLUtils
.
getChildElementBody
(
root
,
"packaging"
)
);
description
=
CommonUtils
.
trim
(
XMLUtils
.
getChildElementBody
(
root
,
"description"
)
);
if
(
description
!=
null
)
{
description
=
TextUtils
.
compactWhiteSpaces
(
description
.
trim
());
}
...
...
@@ -264,9 +264,9 @@ public class MavenArtifactVersion implements IMavenIdentifier {
// Parent
Element
parentElement
=
XMLUtils
.
getChildElement
(
root
,
"parent"
);
if
(
parentElement
!=
null
)
{
String
parentGroupId
=
XMLUtils
.
getChildElementBody
(
parentElement
,
"groupId"
);
String
parentArtifactId
=
XMLUtils
.
getChildElementBody
(
parentElement
,
"artifactId"
);
String
parentVersion
=
XMLUtils
.
getChildElementBody
(
parentElement
,
"version"
);
String
parentGroupId
=
CommonUtils
.
trim
(
XMLUtils
.
getChildElementBody
(
parentElement
,
"groupId"
)
);
String
parentArtifactId
=
CommonUtils
.
trim
(
XMLUtils
.
getChildElementBody
(
parentElement
,
"artifactId"
)
);
String
parentVersion
=
CommonUtils
.
trim
(
XMLUtils
.
getChildElementBody
(
parentElement
,
"version"
)
);
if
(
parentGroupId
==
null
||
parentArtifactId
==
null
||
parentVersion
==
null
)
{
log
.
error
(
"Broken parent reference: "
+
parentGroupId
+
":"
+
parentArtifactId
+
":"
+
parentVersion
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录