Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
bc58b2ac
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
bc58b2ac
编写于
11月 19, 2011
作者:
C
Christoph Kutzinski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minimized serialization profile of FilterImpl
上级
7bba3abc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
21 deletion
+36
-21
maven-plugin/src/main/java/hudson/maven/AbstractMavenBuilder.java
...ugin/src/main/java/hudson/maven/AbstractMavenBuilder.java
+16
-3
maven-plugin/src/main/java/hudson/maven/Maven2Builder.java
maven-plugin/src/main/java/hudson/maven/Maven2Builder.java
+5
-5
maven-plugin/src/main/java/hudson/maven/Maven3Builder.java
maven-plugin/src/main/java/hudson/maven/Maven3Builder.java
+15
-13
未找到文件。
maven-plugin/src/main/java/hudson/maven/AbstractMavenBuilder.java
浏览文件 @
bc58b2ac
...
...
@@ -61,11 +61,13 @@ public abstract class AbstractMavenBuilder implements DelegatingCallable<Result,
*/
protected
final
BuildListener
listener
;
protected
Map
<
ModuleName
,
FilterImpl
>
proxies
;
/**
* Record all asynchronous executions as they are scheduled,
* to make sure they are all completed before we finish.
*/
pr
ivate
transient
/*final*/
List
<
Future
<?>>
futures
;
pr
otected
transient
/*final*/
List
<
Future
<?>>
futures
;
protected
AbstractMavenBuilder
(
BuildListener
listener
,
List
<
String
>
goals
,
Map
<
String
,
String
>
systemProps
)
{
this
.
listener
=
listener
;
...
...
@@ -119,6 +121,11 @@ public abstract class AbstractMavenBuilder implements DelegatingCallable<Result,
*/
protected
void
initializeAsynchronousExecutions
()
{
futures
=
new
CopyOnWriteArrayList
<
Future
<?>>();
if
(
this
.
proxies
!=
null
)
{
for
(
FilterImpl
proxy
:
this
.
proxies
.
values
())
{
proxy
.
setFutures
(
futures
);
}
}
}
/**
...
...
@@ -160,7 +167,7 @@ public abstract class AbstractMavenBuilder implements DelegatingCallable<Result,
}
}
protected
class
FilterImpl
extends
MavenBuildProxy2
.
Filter
<
MavenBuildProxy2
>
implements
Serializable
{
protected
static
class
FilterImpl
extends
MavenBuildProxy2
.
Filter
<
MavenBuildProxy2
>
implements
Serializable
{
private
MavenBuildInformation
mavenBuildInformation
;
...
...
@@ -173,6 +180,8 @@ public abstract class AbstractMavenBuilder implements DelegatingCallable<Result,
*/
private
transient
Channel
channel
;
private
transient
List
<
Future
<?>>
futures
;
public
FilterImpl
(
MavenBuildProxy2
core
,
MavenBuildInformation
mavenBuildInformation
)
{
super
(
core
);
this
.
mavenBuildInformation
=
mavenBuildInformation
;
...
...
@@ -189,7 +198,7 @@ public abstract class AbstractMavenBuilder implements DelegatingCallable<Result,
@Override
public
void
executeAsync
(
final
BuildCallable
<?,?>
program
)
throws
IOException
{
recordAsynchronousExecution
(
futures
.
add
(
channel
.
callAsync
(
new
AsyncInvoker
(
core
,
program
)));
}
...
...
@@ -197,6 +206,10 @@ public abstract class AbstractMavenBuilder implements DelegatingCallable<Result,
public
MavenBuildInformation
getMavenBuildInformation
()
{
return
mavenBuildInformation
;
}
public
void
setFutures
(
List
<
Future
<?>>
futures
)
{
this
.
futures
=
futures
;
}
public
Object
readResolve
()
{
channel
=
Channel
.
current
();
...
...
maven-plugin/src/main/java/hudson/maven/Maven2Builder.java
浏览文件 @
bc58b2ac
...
...
@@ -53,7 +53,6 @@ import org.apache.maven.project.MavenProject;
*/
@SuppressWarnings
(
"deprecation"
)
// as we're restricted to Maven 2.x API here, but compile against Maven 3.x, we cannot avoid deprecations
final
class
Maven2Builder
extends
MavenBuilder
{
private
final
Map
<
ModuleName
,
MavenBuildProxy2
>
proxies
;
private
final
Map
<
ModuleName
,
List
<
MavenReporter
>>
reporters
=
new
HashMap
<
ModuleName
,
List
<
MavenReporter
>>();
private
final
Map
<
ModuleName
,
List
<
ExecutedMojo
>>
executedMojos
=
new
HashMap
<
ModuleName
,
List
<
ExecutedMojo
>>();
private
long
mojoStartTime
;
...
...
@@ -68,9 +67,10 @@ final class Maven2Builder extends MavenBuilder {
public
Maven2Builder
(
BuildListener
listener
,
Map
<
ModuleName
,
ProxyImpl2
>
proxies
,
Collection
<
MavenModule
>
modules
,
List
<
String
>
goals
,
Map
<
String
,
String
>
systemProps
,
MavenBuildInformation
mavenBuildInformation
)
{
super
(
listener
,
goals
,
systemProps
);
this
.
sourceProxies
=
proxies
;
this
.
proxies
=
new
HashMap
<
ModuleName
,
MavenBuildProxy2
>(
proxies
);
for
(
Entry
<
ModuleName
,
MavenBuildProxy2
>
e
:
this
.
proxies
.
entrySet
())
e
.
setValue
(
new
FilterImpl
(
e
.
getValue
(),
mavenBuildInformation
));
this
.
proxies
=
new
HashMap
<
ModuleName
,
FilterImpl
>();
for
(
Entry
<
ModuleName
,
ProxyImpl2
>
e
:
this
.
sourceProxies
.
entrySet
())
{
this
.
proxies
.
put
(
e
.
getKey
(),
new
FilterImpl
(
e
.
getValue
(),
mavenBuildInformation
));
}
for
(
MavenModule
m
:
modules
)
reporters
.
put
(
m
.
getModuleName
(),
m
.
createReporters
());
...
...
@@ -116,7 +116,7 @@ final class Maven2Builder extends MavenBuilder {
buildingProjects
.
add
(
new
ModuleName
(
p
));
}
for
(
Entry
<
ModuleName
,
MavenBuildProxy2
>
e
:
this
.
proxies
.
entrySet
())
{
for
(
Entry
<
ModuleName
,
FilterImpl
>
e
:
this
.
proxies
.
entrySet
())
{
if
(!
buildingProjects
.
contains
(
e
.
getKey
()))
{
MavenBuildProxy2
proxy
=
e
.
getValue
();
proxy
.
start
();
...
...
maven-plugin/src/main/java/hudson/maven/Maven3Builder.java
浏览文件 @
bc58b2ac
...
...
@@ -24,6 +24,7 @@
package
hudson.maven
;
import
hudson.Launcher
;
import
hudson.maven.AbstractMavenBuilder.FilterImpl
;
import
hudson.maven.MavenBuild.ProxyImpl2
;
import
hudson.maven.util.ExecutionEventLogger
;
import
hudson.model.BuildListener
;
...
...
@@ -37,13 +38,14 @@ import java.io.PrintStream;
import
java.io.Serializable
;
import
java.lang.reflect.InvocationTargetException
;
import
java.text.NumberFormat
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.logging.Logger
;
...
...
@@ -77,7 +79,6 @@ public class Maven3Builder extends AbstractMavenBuilder implements DelegatingCal
HudsonMavenExecutionResult
mavenExecutionResult
;
private
final
Map
<
ModuleName
,
MavenBuildProxy2
>
proxies
;
private
final
Map
<
ModuleName
,
ProxyImpl2
>
sourceProxies
;
private
final
Map
<
ModuleName
,
List
<
MavenReporter
>>
reporters
=
new
HashMap
<
ModuleName
,
List
<
MavenReporter
>>();
...
...
@@ -87,19 +88,20 @@ public class Maven3Builder extends AbstractMavenBuilder implements DelegatingCal
super
(
listener
,
goals
,
systemProps
);
this
.
mavenBuildInformation
=
mavenBuildInformation
;
sourceProxies
=
new
HashMap
<
ModuleName
,
ProxyImpl2
>(
proxies
);
this
.
proxies
=
new
HashMap
<
ModuleName
,
MavenBuildProxy2
>(
proxies
);
for
(
Entry
<
ModuleName
,
MavenBuildProxy2
>
e
:
this
.
proxies
.
entrySet
())
e
.
setValue
(
new
FilterImpl
(
e
.
getValue
(),
this
.
mavenBuildInformation
));
this
.
proxies
=
new
HashMap
<
ModuleName
,
FilterImpl
>();
for
(
Entry
<
ModuleName
,
ProxyImpl2
>
e
:
this
.
sourceProxies
.
entrySet
())
{
this
.
proxies
.
put
(
e
.
getKey
(),
new
FilterImpl
(
e
.
getValue
(),
mavenBuildInformation
));
}
this
.
reporters
.
putAll
(
reporters
);
}
public
Result
call
()
throws
IOException
{
MavenExecutionListener
mavenExecutionListener
=
new
MavenExecutionListener
(
this
);
try
{
initializeAsynchronousExecutions
();
MavenExecutionListener
mavenExecutionListener
=
new
MavenExecutionListener
(
this
);
Maven3Launcher
.
setMavenExecutionListener
(
mavenExecutionListener
);
markAsSuccess
=
false
;
...
...
@@ -195,7 +197,7 @@ public class Maven3Builder extends AbstractMavenBuilder implements DelegatingCal
long
overheadTime
;
private
final
Map
<
ModuleName
,
MavenBuildProxy2
>
proxies
;
private
final
Map
<
ModuleName
,
FilterImpl
>
proxies
;
private
final
Map
<
ModuleName
,
List
<
ExecutedMojo
>>
executedMojosPerModule
=
new
ConcurrentHashMap
<
ModuleName
,
List
<
ExecutedMojo
>>();
...
...
@@ -207,10 +209,10 @@ public class Maven3Builder extends AbstractMavenBuilder implements DelegatingCal
public
MavenExecutionListener
(
Maven3Builder
maven3Builder
)
{
this
.
maven3Builder
=
maven3Builder
;
this
.
proxies
=
new
ConcurrentHashMap
<
ModuleName
,
MavenBuildProxy2
>(
maven3Builder
.
proxies
);
for
(
Entry
<
ModuleName
,
MavenBuildProxy2
>
e
:
this
.
proxies
.
entrySet
())
this
.
proxies
=
new
ConcurrentHashMap
<
ModuleName
,
FilterImpl
>(
maven3Builder
.
proxies
);
for
(
Entry
<
ModuleName
,
FilterImpl
>
e
:
this
.
proxies
.
entrySet
())
{
e
.
setValue
(
maven3Builder
.
new
FilterImpl
(
e
.
getValue
(),
maven3Builder
.
mavenBuildInformation
,
Channel
.
current
()));
e
.
setValue
(
new
FilterImpl
(
e
.
getValue
(),
maven3Builder
.
mavenBuildInformation
,
Channel
.
current
()));
executedMojosPerModule
.
put
(
e
.
getKey
(),
new
CopyOnWriteArrayList
<
ExecutedMojo
>()
);
}
this
.
reporters
.
putAll
(
new
ConcurrentHashMap
<
ModuleName
,
List
<
MavenReporter
>>(
maven3Builder
.
reporters
)
);
...
...
@@ -218,7 +220,7 @@ public class Maven3Builder extends AbstractMavenBuilder implements DelegatingCal
}
private
MavenBuildProxy2
getMavenBuildProxy2
(
MavenProject
mavenProject
)
{
for
(
Entry
<
ModuleName
,
MavenBuildProxy2
>
entry
:
proxies
.
entrySet
())
{
for
(
Entry
<
ModuleName
,
FilterImpl
>
entry
:
proxies
.
entrySet
())
{
if
(
entry
.
getKey
().
compareTo
(
new
ModuleName
(
mavenProject
)
)
==
0
)
{
return
entry
.
getValue
();
}
...
...
@@ -264,7 +266,7 @@ public class Maven3Builder extends AbstractMavenBuilder implements DelegatingCal
buildingProjects
.
add
(
new
ModuleName
(
p
));
}
for
(
Entry
<
ModuleName
,
MavenBuildProxy2
>
e
:
this
.
proxies
.
entrySet
())
{
for
(
Entry
<
ModuleName
,
FilterImpl
>
e
:
this
.
proxies
.
entrySet
())
{
if
(!
buildingProjects
.
contains
(
e
.
getKey
()))
{
//maven3Builder.listener.getLogger().println("Project " + e.getKey() + " needs not be build");
MavenBuildProxy2
proxy
=
e
.
getValue
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录