Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FIY695
jenkins
提交
5f53febe
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,发现更多精彩内容 >>
提交
5f53febe
编写于
6月 09, 2011
作者:
C
Christoph Kutzinski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIXED JENKINS-7577] NPE in site generation when building a single Maven module
上级
9cdd9cc0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
15 deletion
+30
-15
changelog.html
changelog.html
+3
-0
maven-plugin/src/main/java/hudson/maven/reporters/MavenSiteArchiver.java
...c/main/java/hudson/maven/reporters/MavenSiteArchiver.java
+15
-12
test/src/test/java/hudson/maven/MavenProjectTest.java
test/src/test/java/hudson/maven/MavenProjectTest.java
+12
-3
未找到文件。
changelog.html
浏览文件 @
5f53febe
...
...
@@ -65,6 +65,9 @@ Upcoming changes</a>
(
<a
href=
"https://github.com/jenkinsci/jenkins/pull/151"
>
pull request #151
</a>
)
<li
class=
bug
>
If the user tries to run Jenkins on Java 1.4 and earlier, detect that more gracefully.
<li
class=
bug
>
Fixed NPE in site generation when building a single Maven module
(
<a
href=
"http://issues.jenkins-ci.org/browse/JENKINS-7577"
>
issue 7577
</a>
)
<li
class=
rfe
>
AJP port is customizable in RPM/OpenSUSE packages
(
<a
href=
"https://github.com/jenkinsci/jenkins/pull/149"
>
pull request #149
</a>
)
...
...
maven-plugin/src/main/java/hudson/maven/reporters/MavenSiteArchiver.java
浏览文件 @
5f53febe
...
...
@@ -30,6 +30,7 @@ import hudson.maven.MavenBuild;
import
hudson.maven.MavenBuildProxy
;
import
hudson.maven.MavenModule
;
import
hudson.maven.MavenModuleSet
;
import
hudson.maven.MavenModuleSetBuild
;
import
hudson.maven.MavenReporter
;
import
hudson.maven.MavenReporterDescriptor
;
import
hudson.maven.MojoInfo
;
...
...
@@ -99,19 +100,21 @@ public class MavenSiteArchiver extends MavenReporter {
*
* @return the relative path component to copy sites of multi module builds.
* @throws IOException
* @throws InterruptedException
*/
private
String
getModuleName
(
MavenBuildProxy
build
,
MavenProject
pom
)
throws
IOException
{
final
String
moduleRoot
;
try
{
moduleRoot
=
build
.
execute
(
new
BuildCallable
<
String
,
IOException
>()
{
//@Override
public
String
call
(
MavenBuild
mavenBuild
)
throws
IOException
,
InterruptedException
{
return
mavenBuild
.
getParentBuild
().
getModuleRoot
().
getRemote
();
}
});
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
private
String
getModuleName
(
MavenBuildProxy
build
,
MavenProject
pom
)
throws
IOException
,
InterruptedException
{
String
moduleRoot
=
build
.
execute
(
new
BuildCallable
<
String
,
IOException
>()
{
private
static
final
long
serialVersionUID
=
1L
;
//@Override
public
String
call
(
MavenBuild
mavenBuild
)
throws
IOException
,
InterruptedException
{
MavenModuleSetBuild
moduleSetBuild
=
mavenBuild
.
getModuleSetBuild
();
if
(
moduleSetBuild
==
null
)
{
throw
new
IOException
(
"Parent build not found!"
);
}
return
moduleSetBuild
.
getModuleRoot
().
getRemote
();
}
});
final
File
pomBaseDir
=
pom
.
getBasedir
();
final
File
remoteWorkspaceDir
=
new
File
(
moduleRoot
);
if
(
pomBaseDir
.
equals
(
remoteWorkspaceDir
))
{
...
...
test/src/test/java/hudson/maven/MavenProjectTest.java
100755 → 100644
浏览文件 @
5f53febe
...
...
@@ -23,13 +23,16 @@
*/
package
hudson.maven
;
import
com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException
;
import
hudson.tasks.Maven.MavenInstallation
;
import
java.io.File
;
import
org.junit.Assert
;
import
org.jvnet.hudson.test.Bug
;
import
org.jvnet.hudson.test.ExtractResourceSCM
;
import
org.jvnet.hudson.test.HudsonTestCase
;
import
java.io.File
;
import
com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException
;
/**
* @author huybrechts
...
...
@@ -99,8 +102,14 @@ public class MavenProjectTest extends HudsonTestCase {
wc
.
getPage
(
project
,
"site"
);
wc
.
getPage
(
project
,
"site/core"
);
wc
.
getPage
(
project
,
"site/client"
);
//@Bug(7577): check that site generation succeeds also if only a single module is build
MavenModule
coreModule
=
project
.
getModule
(
"mmtest:core"
);
Assert
.
assertEquals
(
"site"
,
coreModule
.
getGoals
());
buildAndAssertSuccess
(
coreModule
);
wc
.
getPage
(
project
,
"site/core"
);
}
/**
* Check if the the site goal will work when run from a slave.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录