Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
5eabce8d
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,发现更多精彩内容 >>
提交
5eabce8d
编写于
9月 26, 2012
作者:
I
imod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use path returned by SettingsProvider
上级
d8f3b464
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
68 deletion
+22
-68
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
...lugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
+22
-68
未找到文件。
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
浏览文件 @
5eabce8d
...
...
@@ -34,8 +34,6 @@ import hudson.maven.MavenBuild.ProxyImpl2;
import
hudson.maven.reporters.MavenAggregatedArtifactRecord
;
import
hudson.maven.reporters.MavenFingerprinter
;
import
hudson.maven.reporters.MavenMailer
;
import
hudson.maven.settings.SettingConfig
;
import
hudson.maven.settings.SettingsProviderUtils
;
import
hudson.model.AbstractProject
;
import
hudson.model.Action
;
import
hudson.model.Build
;
...
...
@@ -186,7 +184,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
*/
@Override
public
Result
getResult
()
{
Result
r
=
super
.
getResult
();
Result
r
=
super
.
getResult
();
for
(
MavenBuild
b
:
getModuleLastBuilds
().
values
())
{
Result
br
=
b
.
getResult
();
...
...
@@ -560,7 +558,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
private
Map
<
ModuleName
,
MavenBuild
.
ProxyImpl2
>
proxies
;
protected
Result
doRun
(
final
BuildListener
listener
)
throws
Exception
{
Result
r
=
null
;
PrintStream
logger
=
listener
.
getLogger
();
FilePath
remoteSettings
=
null
,
remoteGlobalSettings
=
null
;
...
...
@@ -583,7 +581,10 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
setMavenVersionUsed
(
mavenVersion
);
LOGGER
.
fine
(
getFullDisplayName
()+
" is building with mavenVersion "
+
mavenVersion
+
" from file "
+
mavenInformation
.
getVersionResourcePath
());
remoteSettings
=
SettingsProvider
.
getFilePathOppressed
(
project
.
getSettings
(),
MavenModuleSetBuild
.
this
,
listener
);
remoteGlobalSettings
=
GlobalSettingsProvider
.
getFilePath
(
project
.
getGlobalSettings
(),
MavenModuleSetBuild
.
this
,
listener
);
if
(!
project
.
isAggregatorStyleBuild
())
{
parsePoms
(
listener
,
logger
,
envVars
,
mvn
,
mavenVersion
);
// start module builds
...
...
@@ -606,7 +607,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
buildEnvironments
.
add
(
e
);
e
.
buildEnvVars
(
envVars
);
// #3502: too late for getEnvironment to do this
}
// run pre build steps
if
(!
preBuild
(
listener
,
project
.
getPrebuilders
())
||
!
preBuild
(
listener
,
project
.
getPostbuilders
())
...
...
@@ -620,42 +621,6 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
return
r
;
}
//#######################
// TODO refactor/remove this in favor to the new SettingsProvider EPs
String
settingsConfigId
=
project
.
getSettingConfigId
();
if
(
StringUtils
.
isNotBlank
(
settingsConfigId
))
{
SettingConfig
settingsConfig
=
SettingsProviderUtils
.
findSettings
(
settingsConfigId
);
if
(
settingsConfig
==
null
)
{
logger
.
println
(
" your Apache Maven build is setup to use a config with id "
+
settingsConfigId
+
" but cannot find the config"
);
}
else
{
logger
.
println
(
"using settings config with name "
+
settingsConfig
.
name
);
if
(
settingsConfig
.
content
!=
null
)
{
remoteSettings
=
SettingsProviderUtils
.
copyConfigContentToFilePath
(
settingsConfig
,
getWorkspace
()
);
project
.
setAlternateSettings
(
remoteSettings
.
getRemote
()
);
}
}
}
String
globalSettingsConfigId
=
project
.
getGlobalSettingConfigId
();
if
(
StringUtils
.
isNotBlank
(
globalSettingsConfigId
))
{
SettingConfig
settingsConfig
=
SettingsProviderUtils
.
findSettings
(
globalSettingsConfigId
);
if
(
settingsConfig
==
null
)
{
logger
.
println
(
" your Apache Maven build is setup to use a global settings config with id "
+
globalSettingsConfigId
+
" but cannot find the config"
);
}
else
{
logger
.
println
(
"using global settings config with name "
+
settingsConfig
.
name
);
if
(
settingsConfig
.
content
!=
null
)
{
remoteGlobalSettings
=
SettingsProviderUtils
.
copyConfigContentToFilePath
(
settingsConfig
,
getWorkspace
()
);
project
.
globalSettingConfigPath
=
remoteGlobalSettings
.
getRemote
();
}
}
}
else
{
// make sure the transient field is clean
project
.
globalSettingConfigPath
=
null
;
}
//#######################
parsePoms
(
listener
,
logger
,
envVars
,
mvn
,
mavenVersion
);
// #5428 : do pre-build *before* parsing pom
SplittableBuildListener
slistener
=
new
SplittableBuildListener
(
listener
);
proxies
=
new
HashMap
<
ModuleName
,
ProxyImpl2
>();
...
...
@@ -724,14 +689,11 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
if
(
localRepo
!=
null
)
margs
.
add
(
"-Dmaven.repo.local="
+
localRepo
.
getRemote
());
if
(
project
.
globalSettingConfigPath
!=
null
)
margs
.
add
(
"-
gs"
,
project
.
globalSettingConfigPath
);
if
(
remoteSettings
!=
null
)
margs
.
add
(
"-
s"
,
remoteSettings
.
getRemote
()
);
GlobalSettingsProvider
gsettings
=
project
.
getGlobalSettings
();
if
(
gsettings
!=
null
)
{
gsettings
.
configure
(
margs
,
MavenModuleSetBuild
.
this
);
}
if
(
remoteGlobalSettings
!=
null
)
margs
.
add
(
"-gs"
,
remoteGlobalSettings
.
getRemote
());
// If incrementalBuild is set
// and the previous build didn't specify that we need a full build
...
...
@@ -747,10 +709,6 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
margs
.
add
(
"-pl"
,
Util
.
join
(
changedModules
,
","
));
}
SettingsProvider
settings
=
project
.
getSettings
();
if
(
settings
!=
null
)
{
settings
.
configure
(
margs
,
MavenModuleSetBuild
.
this
);
}
final
List
<
MavenArgumentInterceptorAction
>
argInterceptors
=
this
.
getBuild
().
getActions
(
MavenArgumentInterceptorAction
.
class
);
...
...
@@ -846,18 +804,14 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
logger
.
println
(
"project.getRootModule()="
+
project
.
getRootModule
());
throw
e
;
}
finally
{
if
(
StringUtils
.
isNotBlank
(
project
.
getSettingConfigId
()))
{
// restore to null if as was modified
project
.
setAlternateSettings
(
null
);
project
.
save
();
}
// delete tmp files used for MavenSettingsProvider
if
(
remoteSettings
!=
null
)
{
remoteSettings
.
delete
();
}
if
(
remoteGlobalSettings
!=
null
)
{
remoteGlobalSettings
.
delete
();
}
// TODO implement a hook to let SettingsProvider have the decision whether a settings.xml must be deleted
// if (remoteSettings != null) {
// remoteSettings.delete();
// }
// if (remoteGlobalSettings != null ) {
// remoteGlobalSettings.delete();
// }
}
}
...
...
@@ -1110,9 +1064,10 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
}
else
{
this
.
privateRepository
=
null
;
}
// TODO maybe in goals with -s,--settings
// or -Dmaven.repo.local
this
.
alternateSettings
=
project
.
getAlternateSettings
();
this
.
alternateSettings
=
SettingsProvider
.
getRemotePath
(
project
.
getSettings
(),
build
,
listener
);
this
.
globalSetings
=
GlobalSettingsProvider
.
getRemotePath
(
project
.
getGlobalSettings
(),
build
,
listener
);
this
.
mavenVersion
=
mavenVersion
;
this
.
resolveDependencies
=
project
.
isResolveDependencies
();
this
.
processPlugins
=
project
.
isProcessPlugins
();
...
...
@@ -1121,7 +1076,6 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
project
.
getScm
().
getModuleRoot
(
build
.
getWorkspace
(),
project
.
getLastBuild
()
).
getRemote
();
this
.
mavenValidationLevel
=
project
.
getMavenValidationLevel
();
this
.
globalSetings
=
project
.
globalSettingConfigPath
;
}
private
boolean
isUpdateSnapshots
(
String
goals
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录