Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FIY695
jenkins
提交
d5b8cf4a
J
jenkins
项目概览
FIY695
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
d5b8cf4a
编写于
6月 02, 2011
作者:
C
Christoph Kutzinski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIXED JENKINS-9848] if POM parsing failed, do a full build next time (for incremental builds)
上级
c297835a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
50 addition
and
6 deletion
+50
-6
changelog.html
changelog.html
+3
-0
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
...lugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
+23
-6
maven-plugin/src/main/java/hudson/maven/NeedsFullBuildAction.java
...ugin/src/main/java/hudson/maven/NeedsFullBuildAction.java
+24
-0
未找到文件。
changelog.html
浏览文件 @
d5b8cf4a
...
...
@@ -59,6 +59,9 @@ Upcoming changes</a>
Output correct version from java -jar jenkins.war --version (broken since 1.410)
<li
class=
bug
>
Correct usage text from java -jar jenkins.war --help
<li
class=
bug
>
Incremental maven jobs: if POM parsing failed, do a full build next time.
(
<a
href=
"http://issues.jenkins-ci.org/browse/JENKINS-9848"
>
issue 9848
</a>
)
<li
class=
rfe
>
CLI command page now lists all the available commands
(
<a
href=
"http://issues.jenkins-ci.org/browse/JENKINS-9789"
>
issue 9789
</a>
)
...
...
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
浏览文件 @
d5b8cf4a
...
...
@@ -374,7 +374,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
* Gets the version of Maven used for build.
*
* @return
* null if this build is done by earlier version of
Hudson
that didn't record this information
* null if this build is done by earlier version of
Jenkins
that didn't record this information
* (this means the build was done by Maven2.x)
*/
public
String
getMavenVersionUsed
()
{
...
...
@@ -407,7 +407,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
/**
* Computes the latest module builds that correspond to this build.
* (when indiv
u
dual modules are built, a new ModuleSetBuild is not created,
* (when indiv
i
dual modules are built, a new ModuleSetBuild is not created,
* but rather the new module build falls under the previous ModuleSetBuild)
*/
public
Map
<
MavenModule
,
MavenBuild
>
getModuleLastBuilds
()
{
...
...
@@ -672,6 +672,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
}
else
{
LOGGER
.
info
(
"using maven 2 "
+
mavenVersion
);
process
=
MavenBuild
.
mavenProcessCache
.
get
(
launcher
.
getChannel
(),
slistener
,
new
MavenProcessFactory
(
project
,
launcher
,
envVars
,
getMavenOpts
(
listener
),
...
...
@@ -680,11 +681,17 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
ArgumentListBuilder
margs
=
new
ArgumentListBuilder
().
add
(
"-B"
).
add
(
"-f"
,
pom
.
getRemote
());
if
(
project
.
usesPrivateRepository
())
margs
.
add
(
"-Dmaven.repo.local="
+
getWorkspace
().
child
(
".repository"
));
// If incrementalBuild is set, and we're on Maven 2.1 or later, *and* there's at least one module
// listed in changedModules, do the Maven incremental build commands - if there are no changed modules,
// We're building everything anyway.
// If incrementalBuild is set
// and the previous build didn't specify that we need a full build
// and we're on Maven 2.1 or later
// and there's at least one module listed in changedModules,
// then do the Maven incremental build commands.
// If there are no changed modules, we're building everything anyway.
boolean
maven2_1orLater
=
new
ComparableVersion
(
mavenVersion
).
compareTo
(
new
ComparableVersion
(
"2.1"
)
)
>=
0
;
if
(
project
.
isIncrementalBuild
()
&&
maven2_1orLater
&&
!
changedModules
.
isEmpty
())
{
boolean
needsFullBuild
=
getPreviousCompletedBuild
()
!=
null
&&
getPreviousCompletedBuild
().
getAction
(
NeedsFullBuildAction
.
class
)
!=
null
;
if
(
project
.
isIncrementalBuild
()
&&
!
needsFullBuild
&&
maven2_1orLater
&&
!
changedModules
.
isEmpty
())
{
margs
.
add
(
"-amd"
);
margs
.
add
(
"-pl"
,
Util
.
join
(
changedModules
,
","
));
}
...
...
@@ -816,12 +823,22 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
try
{
poms
=
getModuleRoot
().
act
(
new
PomParser
(
listener
,
mvn
,
project
,
mavenVersion
,
envVars
));
}
catch
(
IOException
e
)
{
if
(
project
.
isIncrementalBuild
())
{
// If POM parsing failed we should do a full build next time.
// Otherwise only the modules which have a SCM change for the next build might
// be build next time.
getActions
().
add
(
new
NeedsFullBuildAction
());
}
if
(
e
.
getCause
()
instanceof
AbortException
)
throw
(
AbortException
)
e
.
getCause
();
throw
e
;
}
catch
(
MavenExecutionException
e
)
{
// Maven failed to parse POM
e
.
getCause
().
printStackTrace
(
listener
.
error
(
Messages
.
MavenModuleSetBuild_FailedToParsePom
()));
if
(
project
.
isIncrementalBuild
())
{
getActions
().
add
(
new
NeedsFullBuildAction
());
}
throw
new
AbortException
();
}
...
...
maven-plugin/src/main/java/hudson/maven/NeedsFullBuildAction.java
0 → 100644
浏览文件 @
d5b8cf4a
package
hudson.maven
;
import
hudson.model.Action
;
/**
* Action signalling that this {@link MavenModuleSet} needs a full build
* on the next run even if it's marked as an incremental build.
*
* @author kutzi
*/
public
class
NeedsFullBuildAction
implements
Action
{
public
String
getIconFileName
()
{
return
null
;
}
public
String
getDisplayName
()
{
return
null
;
}
public
String
getUrlName
()
{
return
null
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录