Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
4742d022
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
4742d022
编写于
12月 31, 2010
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Moved the maven version information to MavenModuleSetBuild.
上级
647bf138
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
30 addition
and
24 deletion
+30
-24
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
+2
-3
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
+0
-11
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
...lugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
+19
-1
maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifactRecord.java
...main/java/hudson/maven/reporters/MavenArtifactRecord.java
+1
-1
test/src/test/java/hudson/maven/Maven3BuildTest.java
test/src/test/java/hudson/maven/Maven3BuildTest.java
+6
-6
test/src/test/java/hudson/maven/RedeployPublisherTest.java
test/src/test/java/hudson/maven/RedeployPublisherTest.java
+2
-2
未找到文件。
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
浏览文件 @
4742d022
...
...
@@ -415,9 +415,8 @@ public class MavenBuild extends AbstractMavenBuild<MavenModule,MavenBuild> {
return
Channel
.
current
().
export
(
MavenBuildProxy
.
class
,
this
);
}
public
MavenBuildInformation
getMavenBuildInformation
()
{
return
new
MavenBuildInformation
(
MavenBuild
.
this
.
getModuleSetBuild
().
getProject
().
getMavenVersionUsed
());
public
MavenBuildInformation
getMavenBuildInformation
()
{
return
new
MavenBuildInformation
(
MavenBuild
.
this
.
getModuleSetBuild
().
getMavenVersionUsed
());
}
}
...
...
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
浏览文件 @
4742d022
...
...
@@ -180,8 +180,6 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
* If true, do not archive artifacts to the master.
*/
private
boolean
archivingDisabled
=
false
;
private
String
mavenVersionUsed
;
/**
* Reporters configured at {@link MavenModuleSet} level. Applies to all {@link MavenModule} builds.
...
...
@@ -636,15 +634,6 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
this
.
alternateSettings
=
alternateSettings
;
save
();
}
public
String
getMavenVersionUsed
()
{
return
mavenVersionUsed
;
}
public
void
setMavenVersionUsed
(
String
mavenVersionUsed
)
throws
IOException
{
this
.
mavenVersionUsed
=
mavenVersionUsed
;
save
();
}
/**
* If the list of configured goals contain the "-P" option,
...
...
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
浏览文件 @
4742d022
...
...
@@ -117,6 +117,8 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
*/
/*package*/
List
<
MavenReporter
>
projectActionReporters
;
private
String
mavenVersionUsed
;
public
MavenModuleSetBuild
(
MavenModuleSet
job
)
throws
IOException
{
super
(
job
);
}
...
...
@@ -301,6 +303,22 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
return
Math
.
round
((
double
)
overhead
/
moduleSetBuilds
.
size
());
}
/**
* 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
* (this means the build was done by Maven2.x)
*/
public
String
getMavenVersionUsed
()
{
return
mavenVersionUsed
;
}
public
void
setMavenVersionUsed
(
String
mavenVersionUsed
)
throws
IOException
{
this
.
mavenVersionUsed
=
mavenVersionUsed
;
save
();
}
@Override
public
synchronized
void
delete
()
throws
IOException
{
super
.
delete
();
...
...
@@ -475,7 +493,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
MavenBuildInformation
mavenBuildInformation
=
new
MavenBuildInformation
(
mavenVersion
);
project
.
setMavenVersionUsed
(
mavenVersion
);
setMavenVersionUsed
(
mavenVersion
);
listener
.
getLogger
().
println
(
"Found mavenVersion "
+
mavenVersion
+
" from file "
+
mavenInformation
.
getVersionResourcePath
());
...
...
maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifactRecord.java
浏览文件 @
4742d022
...
...
@@ -112,7 +112,7 @@ public class MavenArtifactRecord extends MavenAbstractArtifactRecord<MavenBuild>
ArtifactFactory
factory
=
embedder
.
lookup
(
ArtifactFactory
.
class
);
PrintStream
logger
=
listener
.
getLogger
();
boolean
maven3orLater
=
MavenUtil
.
maven3orLater
(
parent
.
getModuleSetBuild
().
getProject
().
getMavenVersionUsed
());
boolean
maven3orLater
=
MavenUtil
.
maven3orLater
(
parent
.
getModuleSetBuild
().
getMavenVersionUsed
());
if
(!
deploymentRepository
.
isUniqueVersion
()
&&
maven3orLater
)
{
logger
.
println
(
"uniqueVersion == false is not anymore supported in maven 3"
);
((
WrappedArtifactRepository
)
deploymentRepository
).
setUniqueVersion
(
true
);
...
...
test/src/test/java/hudson/maven/Maven3BuildTest.java
浏览文件 @
4742d022
...
...
@@ -26,8 +26,8 @@ public class Maven3BuildTest extends HudsonTestCase {
m
.
getReporters
().
add
(
new
TestReporter
());
m
.
setScm
(
new
ExtractResourceSCM
(
getClass
().
getResource
(
"maven3-project.zip"
)));
m
.
setGoals
(
"clean install"
);
buildAndAssertSuccess
(
m
);
assertTrue
(
MavenUtil
.
maven3orLater
(
m
.
getMavenVersionUsed
()
)
);
MavenModuleSetBuild
b
=
buildAndAssertSuccess
(
m
);
assertTrue
(
MavenUtil
.
maven3orLater
(
b
.
getMavenVersionUsed
()
)
);
}
public
void
testSimpleMaven3BuildRedeployPublisher
()
throws
Exception
{
...
...
@@ -41,8 +41,8 @@ public class Maven3BuildTest extends HudsonTestCase {
m
.
getPublishersList
().
add
(
new
RedeployPublisher
(
""
,
repo
.
toURI
().
toString
(),
true
,
false
));
m
.
setScm
(
new
ExtractResourceSCM
(
getClass
().
getResource
(
"maven3-project.zip"
)));
m
.
setGoals
(
"clean install"
);
buildAndAssertSuccess
(
m
);
assertTrue
(
MavenUtil
.
maven3orLater
(
m
.
getMavenVersionUsed
()
)
);
MavenModuleSetBuild
b
=
buildAndAssertSuccess
(
m
);
assertTrue
(
MavenUtil
.
maven3orLater
(
b
.
getMavenVersionUsed
()
)
);
File
artifactDir
=
new
File
(
repo
,
"com/mycompany/app/my-app/1.7-SNAPSHOT/"
);
String
[]
files
=
artifactDir
.
list
(
new
FilenameFilter
()
{
...
...
@@ -64,8 +64,8 @@ public class Maven3BuildTest extends HudsonTestCase {
m
.
getReporters
().
add
(
new
TestReporter
());
m
.
setScm
(
new
ExtractResourceSCM
(
getClass
().
getResource
(
"maven3-project.zip"
)));
m
.
setGoals
(
"clean site"
);
buildAndAssertSuccess
(
m
);
assertTrue
(
MavenUtil
.
maven3orLater
(
m
.
getMavenVersionUsed
()
)
);
MavenModuleSetBuild
b
=
buildAndAssertSuccess
(
m
);
assertTrue
(
MavenUtil
.
maven3orLater
(
b
.
getMavenVersionUsed
()
)
);
}
...
...
test/src/test/java/hudson/maven/RedeployPublisherTest.java
浏览文件 @
4742d022
...
...
@@ -143,7 +143,7 @@ public class RedeployPublisherTest extends HudsonTestCase {
MavenModuleSetBuild
b
=
m3
.
scheduleBuild2
(
0
).
get
();
assertBuildStatus
(
Result
.
SUCCESS
,
b
);
assertTrue
(
MavenUtil
.
maven3orLater
(
m3
.
getMavenVersionUsed
()
)
);
assertTrue
(
MavenUtil
.
maven3orLater
(
b
.
getMavenVersionUsed
()
)
);
File
artifactDir
=
new
File
(
repo
,
"test/test/0.1-SNAPSHOT/"
);
String
[]
files
=
artifactDir
.
list
(
new
FilenameFilter
()
{
...
...
@@ -170,7 +170,7 @@ public class RedeployPublisherTest extends HudsonTestCase {
MavenModuleSetBuild
b
=
m3
.
scheduleBuild2
(
0
).
get
();
assertBuildStatus
(
Result
.
SUCCESS
,
b
);
assertTrue
(
MavenUtil
.
maven3orLater
(
m3
.
getMavenVersionUsed
()
)
);
assertTrue
(
MavenUtil
.
maven3orLater
(
b
.
getMavenVersionUsed
()
)
);
File
artifactDir
=
new
File
(
repo
,
"test/test/0.1-SNAPSHOT/"
);
String
[]
files
=
artifactDir
.
list
(
new
FilenameFilter
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录