Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
ad60e8e8
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ad60e8e8
编写于
6月 07, 2013
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
doc improvements and shortening variable names in the hope of making it bit more readable
上级
b1f5d28f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
36 deletion
+45
-36
maven-plugin/src/main/java/hudson/maven/MavenEmbedderRequest.java
...ugin/src/main/java/hudson/maven/MavenEmbedderRequest.java
+5
-0
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
+2
-0
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
...lugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
+15
-13
maven-plugin/src/main/java/hudson/maven/MavenUtil.java
maven-plugin/src/main/java/hudson/maven/MavenUtil.java
+23
-23
未找到文件。
maven-plugin/src/main/java/hudson/maven/MavenEmbedderRequest.java
浏览文件 @
ad60e8e8
...
...
@@ -229,6 +229,11 @@ public class MavenEmbedderRequest
return
validationLevel
;
}
/**
* Controls the level of error checks done while parsing POM.
*
* @see ModelBuildingRequest#VALIDATION_LEVEL_MAVEN_3_0
*/
public
MavenEmbedderRequest
setValidationLevel
(
int
validationLevel
)
{
this
.
validationLevel
=
validationLevel
;
return
this
;
...
...
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
浏览文件 @
ad60e8e8
...
...
@@ -248,7 +248,9 @@ public class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,MavenMod
/**
* parameter for validation level during pom parsing by default the one corresponding
* to the maven version used (2 or 3)
*
* @since 1.394
* @see DescriptorImpl#mavenValidationLevels
*/
private
int
mavenValidationLevel
=
-
1
;
...
...
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
浏览文件 @
ad60e8e8
...
...
@@ -25,6 +25,8 @@
package
hudson.maven
;
import
static
hudson
.
model
.
Result
.
FAILURE
;
import
static
org
.
apache
.
maven
.
model
.
building
.
ModelBuildingRequest
.
VALIDATION_LEVEL_MAVEN_3_0
;
import
hudson.AbortException
;
import
hudson.EnvVars
;
import
hudson.FilePath
;
...
...
@@ -1172,16 +1174,16 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
}
try
{
MavenEmbedderRequest
m
avenEmbedderRequest
=
new
MavenEmbedderRequest
(
listener
,
mavenHome
.
getHomeDir
(),
MavenEmbedderRequest
m
er
=
new
MavenEmbedderRequest
(
listener
,
mavenHome
.
getHomeDir
(),
profiles
,
properties
,
privateRepository
,
settingsLoc
);
m
avenEmbedderRequest
.
setTransferListener
(
new
SimpleTransferListener
(
listener
)
);
m
avenEmbedderRequest
.
setUpdateSnapshots
(
this
.
updateSnapshots
);
m
er
.
setTransferListener
(
new
SimpleTransferListener
(
listener
)
);
m
er
.
setUpdateSnapshots
(
this
.
updateSnapshots
);
m
avenEmbedderRequest
.
setProcessPlugins
(
this
.
processPlugins
);
m
avenEmbedderRequest
.
setResolveDependencies
(
this
.
resolveDependencies
);
m
er
.
setProcessPlugins
(
this
.
processPlugins
);
m
er
.
setResolveDependencies
(
this
.
resolveDependencies
);
if
(
globalSettings
!=
null
)
{
m
avenEmbedderRequest
.
setGlobalSettings
(
new
File
(
globalSettings
)
);
m
er
.
setGlobalSettings
(
new
File
(
globalSettings
)
);
}
// FIXME handle 3.1 level when version will be here : no rush :-)
...
...
@@ -1189,28 +1191,28 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
ReactorReader
reactorReader
=
null
;
boolean
maven3OrLater
=
MavenUtil
.
maven3orLater
(
mavenVersion
);
if
(
maven3OrLater
)
{
m
avenEmbedderRequest
.
setValidationLevel
(
ModelBuildingRequest
.
VALIDATION_LEVEL_MAVEN_3_0
);
m
er
.
setValidationLevel
(
VALIDATION_LEVEL_MAVEN_3_0
);
}
else
{
reactorReader
=
new
ReactorReader
(
new
HashMap
<
String
,
MavenProject
>(),
new
File
(
workspaceProper
)
);
m
avenEmbedderRequest
.
setWorkspaceReader
(
reactorReader
);
m
er
.
setWorkspaceReader
(
reactorReader
);
}
{
// create a classloader that loads extensions
List
<
URL
>
urls
=
plexusContributors
.
getPlexusComponentJars
();
if
(!
urls
.
isEmpty
())
{
m
avenEmbedderRequest
.
setClassLoader
(
new
URLClassLoader
(
urls
.
toArray
(
new
URL
[
urls
.
size
()]),
mavenEmbedderRequest
.
getClassLoader
()));
m
er
.
setClassLoader
(
new
URLClassLoader
(
urls
.
toArray
(
new
URL
[
urls
.
size
()]),
mer
.
getClassLoader
()));
}
}
if
(
this
.
mavenValidationLevel
>=
0
)
{
m
avenEmbedderRequest
.
setValidationLevel
(
this
.
mavenValidationLevel
);
m
er
.
setValidationLevel
(
this
.
mavenValidationLevel
);
}
//mavenEmbedderRequest.setClassLoader( MavenEmbedderUtils.buildClassRealm( mavenHome.getHomeDir(), null, null ) );
MavenEmbedder
embedder
=
MavenUtil
.
createEmbedder
(
m
avenEmbedderRequest
);
MavenEmbedder
embedder
=
MavenUtil
.
createEmbedder
(
m
er
);
MavenProject
rootProject
=
null
;
...
...
maven-plugin/src/main/java/hudson/maven/MavenUtil.java
浏览文件 @
ad60e8e8
...
...
@@ -144,7 +144,7 @@ public class MavenUtil {
*
*/
@SuppressWarnings
(
"RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"
)
public
static
MavenEmbedder
createEmbedder
(
MavenEmbedderRequest
m
avenEmbedderRequest
)
throws
MavenEmbedderException
,
IOException
{
public
static
MavenEmbedder
createEmbedder
(
MavenEmbedderRequest
m
er
)
throws
MavenEmbedderException
,
IOException
{
MavenRequest
mavenRequest
=
new
MavenRequest
();
...
...
@@ -155,48 +155,48 @@ public class MavenUtil {
if
(!
m2Home
.
exists
())
throw
new
AbortException
(
"Failed to create "
+
m2Home
);
if
(
m
avenEmbedderRequest
.
getPrivateRepository
()!=
null
)
mavenRequest
.
setLocalRepositoryPath
(
m
avenEmbedderRequest
.
getPrivateRepository
()
);
if
(
m
er
.
getPrivateRepository
()!=
null
)
mavenRequest
.
setLocalRepositoryPath
(
m
er
.
getPrivateRepository
()
);
if
(
m
avenEmbedderRequest
.
getProfiles
()
!=
null
)
{
mavenRequest
.
setProfiles
(
Arrays
.
asList
(
StringUtils
.
split
(
m
avenEmbedderRequest
.
getProfiles
(),
","
)
));
if
(
m
er
.
getProfiles
()
!=
null
)
{
mavenRequest
.
setProfiles
(
Arrays
.
asList
(
StringUtils
.
split
(
m
er
.
getProfiles
(),
","
)
));
}
if
(
m
avenEmbedderRequest
.
getAlternateSettings
()
!=
null
)
{
mavenRequest
.
setUserSettingsFile
(
m
avenEmbedderRequest
.
getAlternateSettings
().
getAbsolutePath
()
);
if
(
m
er
.
getAlternateSettings
()
!=
null
)
{
mavenRequest
.
setUserSettingsFile
(
m
er
.
getAlternateSettings
().
getAbsolutePath
()
);
}
else
{
mavenRequest
.
setUserSettingsFile
(
new
File
(
m2Home
,
"settings.xml"
).
getAbsolutePath
()
);
}
if
(
m
avenEmbedderRequest
.
getGlobalSettings
()
!=
null
)
{
mavenRequest
.
setGlobalSettingsFile
(
m
avenEmbedderRequest
.
getGlobalSettings
().
getAbsolutePath
()
);
if
(
m
er
.
getGlobalSettings
()
!=
null
)
{
mavenRequest
.
setGlobalSettingsFile
(
m
er
.
getGlobalSettings
().
getAbsolutePath
()
);
}
else
{
mavenRequest
.
setGlobalSettingsFile
(
new
File
(
m
avenEmbedderRequest
.
getMavenHome
(),
"conf/settings.xml"
).
getAbsolutePath
()
);
mavenRequest
.
setGlobalSettingsFile
(
new
File
(
m
er
.
getMavenHome
(),
"conf/settings.xml"
).
getAbsolutePath
()
);
}
if
(
m
avenEmbedderRequest
.
getWorkspaceReader
()
!=
null
)
{
mavenRequest
.
setWorkspaceReader
(
m
avenEmbedderRequest
.
getWorkspaceReader
()
);
if
(
m
er
.
getWorkspaceReader
()
!=
null
)
{
mavenRequest
.
setWorkspaceReader
(
m
er
.
getWorkspaceReader
()
);
}
mavenRequest
.
setUpdateSnapshots
(
m
avenEmbedderRequest
.
isUpdateSnapshots
());
mavenRequest
.
setUpdateSnapshots
(
m
er
.
isUpdateSnapshots
());
// TODO olamy check this sould be userProperties
mavenRequest
.
setSystemProperties
(
m
avenEmbedderRequest
.
getSystemProperties
());
mavenRequest
.
setSystemProperties
(
m
er
.
getSystemProperties
());
if
(
m
avenEmbedderRequest
.
getTransferListener
()
!=
null
)
{
if
(
m
er
.
getTransferListener
()
!=
null
)
{
if
(
debugMavenEmbedder
)
{
m
avenEmbedderRequest
.
getListener
().
getLogger
()
.
println
(
"use transfertListener "
+
m
avenEmbedderRequest
.
getTransferListener
().
getClass
().
getName
()
);
m
er
.
getListener
().
getLogger
()
.
println
(
"use transfertListener "
+
m
er
.
getTransferListener
().
getClass
().
getName
()
);
}
mavenRequest
.
setTransferListener
(
m
avenEmbedderRequest
.
getTransferListener
()
);
mavenRequest
.
setTransferListener
(
m
er
.
getTransferListener
()
);
}
EmbedderLoggerImpl
logger
=
new
EmbedderLoggerImpl
(
m
avenEmbedderRequest
.
getListener
(),
debugMavenEmbedder
?
org
.
codehaus
.
plexus
.
logging
.
Logger
.
LEVEL_DEBUG
new
EmbedderLoggerImpl
(
m
er
.
getListener
(),
debugMavenEmbedder
?
org
.
codehaus
.
plexus
.
logging
.
Logger
.
LEVEL_DEBUG
:
org
.
codehaus
.
plexus
.
logging
.
Logger
.
LEVEL_INFO
);
mavenRequest
.
setMavenLoggerManager
(
logger
);
ClassLoader
mavenEmbedderClassLoader
=
m
avenEmbedderRequest
.
getClassLoader
();
ClassLoader
mavenEmbedderClassLoader
=
m
er
.
getClassLoader
();
{
// are we loading the right components.xml? (and not from Maven that's running Jetty, if we are running in "mvn hudson-dev:run" or "mvn hpi:run"?
Enumeration
<
URL
>
e
=
mavenEmbedderClassLoader
.
getResources
(
"META-INF/plexus/components.xml"
);
...
...
@@ -206,9 +206,9 @@ public class MavenUtil {
}
}
mavenRequest
.
setProcessPlugins
(
m
avenEmbedderRequest
.
isProcessPlugins
()
);
mavenRequest
.
setResolveDependencies
(
m
avenEmbedderRequest
.
isResolveDependencies
()
);
mavenRequest
.
setValidationLevel
(
m
avenEmbedderRequest
.
getValidationLevel
()
);
mavenRequest
.
setProcessPlugins
(
m
er
.
isProcessPlugins
()
);
mavenRequest
.
setResolveDependencies
(
m
er
.
isResolveDependencies
()
);
mavenRequest
.
setValidationLevel
(
m
er
.
getValidationLevel
()
);
// TODO check this MaskingClassLoader with maven 3 artifacts
MavenEmbedder
maven
=
new
MavenEmbedder
(
mavenEmbedderClassLoader
,
mavenRequest
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录