Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
2acc9a83
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,发现更多精彩内容 >>
提交
2acc9a83
编写于
11月 18, 2011
作者:
O
olivier lamy
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:jenkinsci/jenkins
上级
67a8fae0
b835fb15
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
58 addition
and
36 deletion
+58
-36
changelog.html
changelog.html
+3
-0
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
+1
-1
maven-plugin/src/main/java/hudson/maven/MavenBuildInformation.java
...gin/src/main/java/hudson/maven/MavenBuildInformation.java
+28
-0
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
...lugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
+2
-3
maven-plugin/src/main/java/hudson/maven/reporters/MavenFingerprinter.java
.../main/java/hudson/maven/reporters/MavenFingerprinter.java
+13
-14
maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java
...rc/main/java/hudson/maven/reporters/SurefireArchiver.java
+10
-17
test/src/test/java/hudson/slaves/NodeCanTakeTaskTest.java
test/src/test/java/hudson/slaves/NodeCanTakeTaskTest.java
+1
-1
未找到文件。
changelog.html
浏览文件 @
2acc9a83
...
...
@@ -61,6 +61,9 @@ Upcoming changes</a>
<li
class=
bug
>
Fixed NPE in Subversion polling of Maven jobs.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-11592"
>
issue 11592
</a>
)
<li
class=
bug
>
Fixed ConcurrentModificationException in parallel Maven 3 builds.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-11256"
>
issue 11256
</a>
)
<li
class=
rfe
>
CLI jar now has the version number in the manifest as well as the "-version" option.
</ul>
...
...
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
浏览文件 @
2acc9a83
...
...
@@ -660,7 +660,7 @@ public class MavenBuild extends AbstractMavenBuild<MavenModule,MavenBuild> {
LOGGER
.
fine
(
getFullDisplayName
()+
" is building with mavenVersion "
+
mavenVersion
+
" from file "
+
mavenInformation
.
getVersionResourcePath
());
boolean
maven3orLater
=
new
ComparableVersion
(
mavenVersion
).
compareTo
(
new
ComparableVersion
(
"3.0"
)
)
>=
0
;
boolean
maven3orLater
=
MavenUtil
.
maven3orLater
(
mavenVersion
)
;
ProcessCache
.
MavenProcess
process
=
MavenBuild
.
mavenProcessCache
.
get
(
launcher
.
getChannel
(),
listener
,
maven3orLater
?
new
Maven3ProcessFactory
(
...
...
maven-plugin/src/main/java/hudson/maven/MavenBuildInformation.java
浏览文件 @
2acc9a83
...
...
@@ -22,6 +22,9 @@ package hudson.maven;
import
java.io.Serializable
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.maven.artifact.versioning.ComparableVersion
;
/**
* @author Olivier Lamy
* @since 1.392
...
...
@@ -39,4 +42,29 @@ public class MavenBuildInformation implements Serializable {
{
return
mavenVersion
;
}
/**
* @since 1.441
*/
public
boolean
isMaven3OrLater
()
{
return
MavenUtil
.
maven3orLater
(
mavenVersion
);
}
/**
* Returns if this maven version is at least 'version'.
* @param version the version to compare against
*
* @since 1.441
*/
public
boolean
isAtLeastMavenVersion
(
String
version
)
{
if
(
StringUtils
.
isBlank
(
mavenVersion
))
{
return
false
;
}
return
new
ComparableVersion
(
mavenVersion
).
compareTo
(
new
ComparableVersion
(
version
))
>=
0
;
}
@Override
public
String
toString
()
{
return
mavenVersion
;
}
}
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
浏览文件 @
2acc9a83
...
...
@@ -701,8 +701,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
ProcessCache
.
MavenProcess
process
=
null
;
boolean
maven3orLater
=
MavenUtil
.
maven3orLater
(
mavenVersion
);
boolean
maven3orLater
=
mavenBuildInformation
.
isMaven3OrLater
();
if
(
maven3orLater
)
{
LOGGER
.
fine
(
"using maven 3 "
+
mavenVersion
);
...
...
@@ -1190,7 +1189,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
// FIXME handle 3.1 level when version will be here : no rush :-)
// or made something configurable tru the ui ?
ReactorReader
reactorReader
=
null
;
boolean
maven3OrLater
=
new
ComparableVersion
(
mavenVersion
).
compareTo
(
new
ComparableVersion
(
"3.0"
)
)
>=
0
;
boolean
maven3OrLater
=
MavenUtil
.
maven3orLater
(
mavenVersion
)
;
if
(
maven3OrLater
)
{
mavenEmbedderRequest
.
setValidationLevel
(
ModelBuildingRequest
.
VALIDATION_LEVEL_MAVEN_3_0
);
}
else
{
...
...
maven-plugin/src/main/java/hudson/maven/reporters/MavenFingerprinter.java
浏览文件 @
2acc9a83
...
...
@@ -26,6 +26,7 @@ package hudson.maven.reporters;
import
hudson.Extension
;
import
hudson.FilePath
;
import
hudson.maven.MavenBuild
;
import
hudson.maven.MavenBuildInformation
;
import
hudson.maven.MavenBuildProxy
;
import
hudson.maven.MavenBuildProxy.BuildCallable
;
import
hudson.maven.MavenModule
;
...
...
@@ -142,11 +143,9 @@ public class MavenFingerprinter extends MavenReporter {
File
parentFile
=
parent
.
getFile
();
if
(
parentFile
==
null
)
{
String
mavenVersion
=
build
.
getMavenBuildInformation
().
getMavenVersion
();
// Parent artifact contains no actual file, so we resolve against
// the local repository
ArtifactRepository
localRepository
=
getLocalRepository
(
mavenVersion
,
parent
,
pom
);
ArtifactRepository
localRepository
=
getLocalRepository
(
build
.
getMavenBuildInformation
()
,
parent
,
pom
);
if
(
localRepository
!=
null
)
{
Artifact
parentArtifact
=
getArtifact
(
parent
);
// Don't use ArtifactRepository.find(), for compatibility with Maven 2.x
...
...
@@ -179,18 +178,18 @@ public class MavenFingerprinter extends MavenReporter {
return
art
;
}
private
ArtifactRepository
getLocalRepository
(
String
mavenVers
ion
,
MavenProject
parent
,
MavenProject
pom
)
{
if
(
mavenVersion
.
startsWith
(
"2.0"
)
||
mavenVersion
.
startsWith
(
"2.1"
))
{
// Maven 2.0 has no corresponding mechanism
return
null
;
}
else
if
(
mavenVersion
.
startsWith
(
"2.2"
))
{
// principally this should also work with Maven 2.1, but it's not tested, so err on the safe side
return
getArtifactRepositoryMaven21
(
pom
);
}
else
if
(
mavenVersion
.
startsWith
(
"3."
)
||
mavenVersion
.
startsWith
(
"4."
)
/* who knows? ;) */
)
{
return
parent
.
getProjectBuildingRequest
()
.
getLocalRepository
()
;
private
ArtifactRepository
getLocalRepository
(
MavenBuildInformation
mavenBuildInformat
ion
,
MavenProject
parent
,
MavenProject
pom
)
{
if
(
mavenBuildInformation
.
isMaven3OrLater
())
{
return
parent
.
getProjectBuildingRequest
().
getLocalRepository
()
;
}
else
if
(
mavenBuildInformation
.
isAtLeastMavenVersion
(
"2.2"
))
{
// principally this should also work with Maven 2.1, but it's not tested, so err on the safe side
return
getArtifactRepositoryMaven21
(
pom
);
}
else
if
(
mavenBuildInformation
.
isAtLeastMavenVersion
(
"2.0"
)
)
{
// Maven 2.0 has no corresponding mechanism
return
null
;
}
else
{
LOGGER
.
warning
(
"Unknown Maven version: "
+
maven
Version
);
LOGGER
.
warning
(
"Unknown Maven version: "
+
maven
BuildInformation
.
getMavenVersion
()
);
return
null
;
}
}
...
...
maven-plugin/src/main/java/hudson/maven/reporters/SurefireArchiver.java
浏览文件 @
2acc9a83
...
...
@@ -50,8 +50,6 @@ import java.util.ListIterator;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.maven.artifact.versioning.ComparableVersion
;
import
org.apache.maven.plugin.MojoFailureException
;
import
org.apache.maven.project.MavenProject
;
import
org.apache.tools.ant.DirectoryScanner
;
...
...
@@ -65,7 +63,7 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
* @author Kohsuke Kawaguchi
*/
public
class
SurefireArchiver
extends
MavenReporter
{
private
TestResult
result
;
private
transient
TestResult
result
;
/**
* Store the filesets here as we want to track ignores between multiple runs of this class<br/>
...
...
@@ -82,7 +80,7 @@ public class SurefireArchiver extends MavenReporter {
// note that because of the way Maven works, just updating system property at this point is too late
XmlPlexusConfiguration
c
=
(
XmlPlexusConfiguration
)
mojo
.
configuration
.
getChild
(
"testFailureIgnore"
);
if
(
c
!=
null
&&
c
.
getValue
()
!=
null
&&
c
.
getValue
().
equals
(
"${maven.test.failure.ignore}"
)
&&
System
.
getProperty
(
"maven.test.failure.ignore"
)==
null
)
{
if
(
maven3orLater
(
build
.
getMavenBuildInformation
().
getMavenVersion
()
))
{
if
(
build
.
getMavenBuildInformation
().
isMaven3OrLater
(
))
{
String
fieldName
=
"testFailureIgnore"
;
if
(
mojo
.
mojoExecution
.
getConfiguration
().
getChild
(
fieldName
)
!=
null
)
{
mojo
.
mojoExecution
.
getConfiguration
().
getChild
(
fieldName
).
setValue
(
Boolean
.
TRUE
.
toString
()
);
...
...
@@ -138,6 +136,9 @@ public class SurefireArchiver extends MavenReporter {
if
(
result
==
null
)
result
=
new
TestResult
();
result
.
parse
(
System
.
currentTimeMillis
()
-
build
.
getMilliSecsSinceBuildStart
(),
reportsDir
,
reportFiles
);
// final reference in order to serialize it:
final
TestResult
r
=
result
;
int
failCount
=
build
.
execute
(
new
BuildCallable
<
Integer
,
IOException
>()
{
private
static
final
long
serialVersionUID
=
-
1023888330720922136L
;
...
...
@@ -145,13 +146,13 @@ public class SurefireArchiver extends MavenReporter {
public
Integer
call
(
MavenBuild
build
)
throws
IOException
,
InterruptedException
{
SurefireReport
sr
=
build
.
getAction
(
SurefireReport
.
class
);
if
(
sr
==
null
)
build
.
getActions
().
add
(
new
SurefireReport
(
build
,
r
esult
,
listener
));
build
.
getActions
().
add
(
new
SurefireReport
(
build
,
r
,
listener
));
else
sr
.
setResult
(
r
esult
,
listener
);
if
(
r
esult
.
getFailCount
()>
0
)
sr
.
setResult
(
r
,
listener
);
if
(
r
.
getFailCount
()>
0
)
build
.
setResult
(
Result
.
UNSTABLE
);
build
.
registerAsProjectAction
(
new
FactoryImpl
());
return
r
esult
.
getFailCount
();
return
r
.
getFailCount
();
}
});
...
...
@@ -160,7 +161,7 @@ public class SurefireArchiver extends MavenReporter {
if
(
failCount
>
0
&&
error
instanceof
MojoFailureException
)
{
MavenBuilder
.
markAsSuccess
=
true
;
}
// TODO curren
lt
y error is empty : will be here with maven 3.0.2+
// TODO curren
tl
y error is empty : will be here with maven 3.0.2+
if
(
failCount
>
0
)
{
Maven3Builder
.
markAsSuccess
=
true
;
}
...
...
@@ -307,14 +308,6 @@ public class SurefireArchiver extends MavenReporter {
return
true
;
}
public
boolean
maven3orLater
(
String
mavenVersion
)
{
// null or empty so false !
if
(
StringUtils
.
isBlank
(
mavenVersion
))
{
return
false
;
}
return
new
ComparableVersion
(
mavenVersion
).
compareTo
(
new
ComparableVersion
(
"3.0"
)
)
>=
0
;
}
// I'm not sure if SurefireArchiver is actually ever (de-)serialized,
// but just to be sure, set fileSets here
protected
Object
readResolve
()
{
...
...
test/src/test/java/hudson/slaves/NodeCanTakeTaskTest.java
浏览文件 @
2acc9a83
...
...
@@ -58,7 +58,7 @@ public class NodeCanTakeTaskTest extends HudsonTestCase {
// First, attempt to run our project before adding the property
Future
<
FreeStyleBuild
>
build
=
project
.
scheduleBuild2
(
0
);
assertBuildStatus
(
Result
.
SUCCESS
,
build
.
get
(
1
0
,
TimeUnit
.
SECONDS
));
assertBuildStatus
(
Result
.
SUCCESS
,
build
.
get
(
2
0
,
TimeUnit
.
SECONDS
));
// Add the build-blocker property and try again
slave
.
getNodeProperties
().
add
(
new
RejectAllTasksProperty
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录