Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
be7b3adb
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,发现更多精彩内容 >>
提交
be7b3adb
编写于
1月 10, 2011
作者:
O
Olivier Lamy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HUDSON-8406] Add more options to configure maven project building
上级
b02f9cc6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
60 addition
and
7 deletion
+60
-7
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
+41
-6
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
...lugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
+9
-0
maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/configure-entries.jelly
...urces/hudson/maven/MavenModuleSet/configure-entries.jelly
+10
-1
未找到文件。
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
浏览文件 @
be7b3adb
...
...
@@ -73,6 +73,7 @@ import java.util.Arrays;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Properties
;
...
...
@@ -83,6 +84,8 @@ import javax.servlet.ServletException;
import
net.sf.json.JSONObject
;
import
org.apache.commons.lang.math.NumberUtils
;
import
org.apache.maven.model.building.ModelBuildingRequest
;
import
org.kohsuke.stapler.QueryParameter
;
import
org.kohsuke.stapler.StaplerRequest
;
import
org.kohsuke.stapler.StaplerResponse
;
...
...
@@ -193,6 +196,13 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
* @since 1.394
*/
private
boolean
processPlugins
=
false
;
/**
* parameter for validation level during pom parsing by default the one corresponding
* to the maven version used (2 or 3)
* @since 1.394
*/
private
int
mavenValidationLevel
=
-
1
;
/**
* Reporters configured at {@link MavenModuleSet} level. Applies to all {@link MavenModule} builds.
...
...
@@ -376,21 +386,22 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
return
resolveDependencies
;
}
public
void
setResolveDependencies
(
boolean
resolveDependencies
)
{
public
void
setResolveDependencies
(
boolean
resolveDependencies
)
{
this
.
resolveDependencies
=
resolveDependencies
;
}
public
boolean
isProcessPlugins
()
{
public
boolean
isProcessPlugins
()
{
return
processPlugins
;
}
public
void
setProcessPlugins
(
boolean
processPlugins
)
{
public
void
setProcessPlugins
(
boolean
processPlugins
)
{
this
.
processPlugins
=
processPlugins
;
}
public
int
getMavenValidationLevel
()
{
return
mavenValidationLevel
;
}
/**
* List of active {@link MavenReporter}s that should be applied to all module builds.
*/
...
...
@@ -798,6 +809,7 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
archivingDisabled
=
req
.
hasParameter
(
"maven.archivingDisabled"
);
resolveDependencies
=
req
.
hasParameter
(
"maven.resolveDependencies"
);
processPlugins
=
req
.
hasParameter
(
"maven.processPlugins"
);
mavenValidationLevel
=
NumberUtils
.
toInt
(
req
.
getParameter
(
"maven.validationLevel"
),
-
1
);
reporters
.
rebuild
(
req
,
json
,
MavenReporters
.
getConfigurableList
());
publishers
.
rebuild
(
req
,
json
,
BuildStepDescriptor
.
filter
(
Publisher
.
all
(),
this
.
getClass
()));
buildWrappers
.
rebuild
(
req
,
json
,
BuildWrappers
.
getFor
(
this
));
...
...
@@ -860,10 +872,21 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
* Globally-defined MAVEN_OPTS.
*/
private
String
globalMavenOpts
;
/**
* @since 1.394
*/
private
Map
<
String
,
Integer
>
mavenValidationLevels
=
new
LinkedHashMap
<
String
,
Integer
>();
public
DescriptorImpl
()
{
super
();
load
();
mavenValidationLevels
.
put
(
"DEFAULT"
,
-
1
);
mavenValidationLevels
.
put
(
"LEVEL_MINIMAL"
,
ModelBuildingRequest
.
VALIDATION_LEVEL_MINIMAL
);
mavenValidationLevels
.
put
(
"LEVEL_MAVEN_2_0"
,
ModelBuildingRequest
.
VALIDATION_LEVEL_MAVEN_2_0
);
mavenValidationLevels
.
put
(
"LEVEL_MAVEN_3_0"
,
ModelBuildingRequest
.
VALIDATION_LEVEL_MAVEN_3_0
);
mavenValidationLevels
.
put
(
"LEVEL_MAVEN_3_1"
,
ModelBuildingRequest
.
VALIDATION_LEVEL_MAVEN_3_1
);
mavenValidationLevels
.
put
(
"LEVEL_STRICT"
,
ModelBuildingRequest
.
VALIDATION_LEVEL_STRICT
);
}
public
String
getGlobalMavenOpts
()
{
...
...
@@ -886,6 +909,14 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
public
Maven
.
DescriptorImpl
getMavenDescriptor
()
{
return
Hudson
.
getInstance
().
getDescriptorByType
(
Maven
.
DescriptorImpl
.
class
);
}
/**
* @since 1.394
* @return
*/
public
Map
<
String
,
Integer
>
getMavenValidationLevels
()
{
return
mavenValidationLevels
;
}
@Override
public
boolean
configure
(
StaplerRequest
req
,
JSONObject
o
)
{
...
...
@@ -906,9 +937,13 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
Mailer
.
class
,
// for historical reasons, Maven uses MavenMailer
JUnitResultArchiver
.
class
// done by SurefireArchiver
));
}
}
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
浏览文件 @
be7b3adb
...
...
@@ -1007,6 +1007,8 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
private
boolean
processPlugins
=
false
;
private
int
mavenValidationLevel
=
-
1
;
String
rootPOMRelPrefix
;
public
PomParser
(
BuildListener
listener
,
MavenInstallation
mavenHome
,
MavenModuleSet
project
,
String
mavenVersion
)
{
...
...
@@ -1036,6 +1038,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
this
.
mavenVersion
=
mavenVersion
;
this
.
resolveDependencies
=
project
.
isResolveDependencies
();
this
.
processPlugins
=
project
.
isProcessPlugins
();
this
.
mavenValidationLevel
=
project
.
getMavenValidationLevel
();
}
...
...
@@ -1118,6 +1121,12 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
reactorReader
=
new
ReactorReader
(
new
HashMap
<
String
,
MavenProject
>(),
new
File
(
workspaceProper
)
);
mavenEmbedderRequest
.
setWorkspaceReader
(
reactorReader
);
}
if
(
this
.
mavenValidationLevel
>=
0
)
{
mavenEmbedderRequest
.
setValidationLevel
(
this
.
mavenValidationLevel
);
}
//mavenEmbedderRequest.setClassLoader( MavenEmbedderUtils.buildClassRealm( mavenHome.getHomeDir(), null, null ) );
MavenEmbedder
embedder
=
MavenUtil
.
createEmbedder
(
mavenEmbedderRequest
);
...
...
maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/configure-entries.jelly
浏览文件 @
be7b3adb
...
...
@@ -91,7 +91,16 @@ THE SOFTWARE.
<f:optionalBlock name="maven.resolveDependencies" title="${%Resolve Dependencies during Pom parsing}"
checked="${it.isResolveDependencies()}" />
<f:optionalBlock name="maven.processPlugins" title="${%Process Plugins during Pom parsing}"
checked="${it.isProcessPlugins()}" />
checked="${it.isProcessPlugins()}" />
<j:set var="mavenValidationLevels" value="${it.descriptor.mavenValidationLevels}" />
<f:entry title="${%Maven Validation Level}">
<select class="setting-input" name="maven.validationLevel">
<j:forEach var="level" items="${mavenValidationLevels}">
<f:option selected="${it.mavenValidationLevel == level.value}" value="${level.value}">${level.key}</f:option>
</j:forEach>
</select>
</f:entry>
</f:advanced>
</f:section>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录