Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
8c6962e9
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,发现更多精彩内容 >>
提交
8c6962e9
编写于
7月 21, 2013
作者:
O
Olivier Lamy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix Maven31ProcessFactory
上级
b9a77396
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
98 addition
and
13 deletion
+98
-13
maven-plugin/src/main/java/hudson/maven/Maven31ProcessFactory.java
...gin/src/main/java/hudson/maven/Maven31ProcessFactory.java
+95
-9
maven-plugin/src/main/java/hudson/maven/Maven3ProcessFactory.java
...ugin/src/main/java/hudson/maven/Maven3ProcessFactory.java
+3
-4
未找到文件。
maven-plugin/src/main/java/hudson/maven/Maven31ProcessFactory.java
浏览文件 @
8c6962e9
...
...
@@ -27,14 +27,14 @@ import hudson.EnvVars;
import
hudson.FilePath
;
import
hudson.Launcher
;
import
hudson.model.BuildListener
;
import
hudson.model.Run
.RunnerAbortedException
;
import
hudson.model.Run
;
import
hudson.model.TaskListener
;
import
hudson.remoting.Callable
;
import
hudson.remoting.Channel
;
import
hudson.remoting.Which
;
import
hudson.tasks.Maven.MavenInstallation
;
import
org.jvnet.hudson.maven3.agent.Maven3Main
;
import
org.jvnet.hudson.maven3.launcher.Maven3
Launche
r
;
import
org.jvnet.hudson.maven3.launcher.Maven3
1Intercepto
r
;
import
org.jvnet.hudson.maven3.listeners.HudsonMavenExecutionResult
;
import
java.io.File
;
...
...
@@ -47,8 +47,7 @@ import java.net.URL;
*
* @author Olivier Lamy
*/
public
class
Maven31ProcessFactory
extends
Maven3ProcessFactory
public
class
Maven31ProcessFactory
extends
AbstractMavenProcessFactory
implements
ProcessCache
.
Factory
{
Maven31ProcessFactory
(
MavenModuleSet
mms
,
AbstractMavenBuild
<?,
?>
build
,
Launcher
launcher
,
EnvVars
envVars
,
...
...
@@ -56,28 +55,115 @@ public class Maven31ProcessFactory
super
(
mms
,
build
,
launcher
,
envVars
,
mavenOpts
,
workDir
);
}
@Override
protected
String
getMainClassName
()
{
return
Maven3Main
.
class
.
getName
();
}
@Override
protected
String
getMavenAgentClassPath
(
MavenInstallation
mvn
,
boolean
isMaster
,
FilePath
slaveRoot
,
BuildListener
listener
)
throws
IOException
,
InterruptedException
{
String
classWorldsJar
=
getLauncher
().
getChannel
().
call
(
new
Maven3ProcessFactory
.
GetClassWorldsJar
(
mvn
.
getHome
(),
listener
));
return
(
isMaster
?
Which
.
jarFile
(
Maven3Main
.
class
).
getAbsolutePath
():
slaveRoot
.
child
(
"maven31-agent.jar"
).
getRemote
())+
String
path
=
(
isMaster
?
Which
.
jarFile
(
Maven3Main
.
class
).
getAbsolutePath
():
slaveRoot
.
child
(
"maven31-agent.jar"
).
getRemote
())+
(
getLauncher
().
isUnix
()?
":"
:
";"
)+
classWorldsJar
;
return
path
;
}
@Override
protected
String
getMavenInterceptorClassPath
(
MavenInstallation
mvn
,
boolean
isMaster
,
FilePath
slaveRoot
)
throws
IOException
,
InterruptedException
{
return
isMaster
?
Which
.
jarFile
(
Maven3
Launche
r
.
class
).
getAbsolutePath
():
String
path
=
isMaster
?
Which
.
jarFile
(
Maven3
1Intercepto
r
.
class
).
getAbsolutePath
():
slaveRoot
.
child
(
"maven31-interceptor.jar"
).
getRemote
();
return
path
;
}
protected
String
getMavenInterceptorCommonClassPath
(
MavenInstallation
mvn
,
boolean
isMaster
,
FilePath
slaveRoot
)
throws
IOException
,
InterruptedException
{
return
isMaster
?
String
path
=
isMaster
?
Which
.
jarFile
(
HudsonMavenExecutionResult
.
class
).
getAbsolutePath
():
slaveRoot
.
child
(
"maven3-interceptor-commons.jar"
).
getRemote
();
return
path
;
}
@Override
protected
String
getMavenInterceptorOverride
(
MavenInstallation
mvn
,
boolean
isMaster
,
FilePath
slaveRoot
)
throws
IOException
,
InterruptedException
{
return
null
;
}
@Override
protected
void
applyPlexusModuleContributor
(
Channel
channel
,
AbstractMavenBuild
<?,
?>
context
)
throws
InterruptedException
,
IOException
{
channel
.
call
(
new
InstallPlexusModulesTask
(
context
));
}
private
static
final
class
InstallPlexusModulesTask
implements
Callable
<
Void
,
IOException
>
{
PlexusModuleContributor
c
;
public
InstallPlexusModulesTask
(
AbstractMavenBuild
<?,
?>
context
)
throws
IOException
,
InterruptedException
{
c
=
PlexusModuleContributorFactory
.
aggregate
(
context
);
}
public
Void
call
()
throws
IOException
{
org
.
jvnet
.
hudson
.
maven3
.
agent
.
Maven3Main
.
addPlexusComponents
(
c
.
getPlexusComponentJars
().
toArray
(
new
URL
[
0
]
)
);
return
null
;
}
private
static
final
long
serialVersionUID
=
1L
;
}
/**
* Finds classworlds.jar
*/
protected
static
final
class
GetClassWorldsJar
implements
Callable
<
String
,
IOException
>
{
private
static
final
long
serialVersionUID
=
-
2599434124883557137L
;
private
final
String
mvnHome
;
private
final
TaskListener
listener
;
protected
GetClassWorldsJar
(
String
mvnHome
,
TaskListener
listener
)
{
this
.
mvnHome
=
mvnHome
;
this
.
listener
=
listener
;
}
public
String
call
()
throws
IOException
{
File
home
=
new
File
(
mvnHome
);
if
(
MavenProcessFactory
.
debug
)
listener
.
getLogger
().
println
(
"Using mvnHome: "
+
mvnHome
);
File
bootDir
=
new
File
(
home
,
"boot"
);
File
[]
classworlds
=
bootDir
.
listFiles
(
CLASSWORLDS_FILTER
);
if
(
classworlds
==
null
||
classworlds
.
length
==
0
)
{
listener
.
error
(
Messages
.
MavenProcessFactory_ClassWorldsNotFound
(
home
));
throw
new
Run
.
RunnerAbortedException
();
}
return
classworlds
[
0
].
getAbsolutePath
();
}
}
/**
* Locates classworlds jar file.
*
* Note that Maven 3.0 changed the name to plexus-classworlds
*
* <pre>
* $ find tools/ -name "plexus-classworlds*.jar"
* tools/maven-3.0-alpha-2/boot/plexus-classworlds-1.3.jar
* tools/maven-3.0-alpha-3/boot/plexus-classworlds-2.2.2.jar
* tools/maven-3.0-alpha-4/boot/plexus-classworlds-2.2.2.jar
* tools/maven-3.0-alpha-5/boot/plexus-classworlds-2.2.2.jar
* tools/maven-3.0-alpha-6/boot/plexus-classworlds-2.2.2.jar
* </pre>
*/
private
static
final
FilenameFilter
CLASSWORLDS_FILTER
=
new
FilenameFilter
()
{
public
boolean
accept
(
File
dir
,
String
name
)
{
return
name
.
contains
(
"plexus-classworlds"
)
&&
name
.
endsWith
(
".jar"
);
}
};
}
maven-plugin/src/main/java/hudson/maven/Maven3ProcessFactory.java
浏览文件 @
8c6962e9
...
...
@@ -33,16 +33,15 @@ import hudson.remoting.Callable;
import
hudson.remoting.Channel
;
import
hudson.remoting.Which
;
import
hudson.tasks.Maven.MavenInstallation
;
import
org.jvnet.hudson.maven3.agent.Maven3Main
;
import
org.jvnet.hudson.maven3.launcher.Maven3Launcher
;
import
org.jvnet.hudson.maven3.listeners.HudsonMavenExecutionResult
;
import
java.io.File
;
import
java.io.FilenameFilter
;
import
java.io.IOException
;
import
java.net.URL
;
import
org.jvnet.hudson.maven3.agent.Maven3Main
;
import
org.jvnet.hudson.maven3.launcher.Maven3Launcher
;
import
org.jvnet.hudson.maven3.listeners.HudsonMavenExecutionResult
;
/**
* {@link AbstractMavenProcessFactory} for Maven 3.
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录