Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FIY695
jenkins
提交
cee86fbb
J
jenkins
项目概览
FIY695
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
cee86fbb
编写于
7月 02, 2011
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Making artifacts available for downloads.
上级
f53bb92f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
105 addition
and
3 deletion
+105
-3
core/src/main/java/hudson/util/HttpResponses.java
core/src/main/java/hudson/util/HttpResponses.java
+43
-0
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
+8
-1
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
...lugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
+8
-0
maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifact.java
...n/src/main/java/hudson/maven/reporters/MavenArtifact.java
+14
-2
maven-plugin/src/main/resources/hudson/maven/AbstractMavenBuild/_api.jelly
...main/resources/hudson/maven/AbstractMavenBuild/_api.jelly
+32
-0
未找到文件。
core/src/main/java/hudson/util/HttpResponses.java
0 → 100644
浏览文件 @
cee86fbb
/*
* The MIT License
*
* Copyright (c) 2011, CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package
hudson.util
;
import
org.kohsuke.stapler.HttpResponse
;
import
java.io.File
;
import
java.io.IOException
;
/**
* Various {@link HttpResponse} implementations.
*
* <p>
* This class extends from Stapler so that we can move implementations from here to Stapler periodically.
*
* @author Kohsuke Kawaguchi
*/
public
class
HttpResponses
extends
org
.
kohsuke
.
stapler
.
HttpResponses
{
public
static
HttpResponse
staticResource
(
File
f
)
throws
IOException
{
return
staticResource
(
f
.
toURI
().
toURL
());
}
}
maven-plugin/src/main/java/hudson/maven/MavenBuild.java
浏览文件 @
cee86fbb
...
...
@@ -25,7 +25,6 @@ package hudson.maven;
import
hudson.FilePath
;
import
hudson.EnvVars
;
import
hudson.maven.reporters.MavenArtifact
;
import
hudson.maven.reporters.MavenArtifactRecord
;
import
hudson.maven.reporters.SurefireArchiver
;
import
hudson.slaves.WorkspaceList
;
...
...
@@ -184,6 +183,14 @@ public class MavenBuild extends AbstractMavenBuild<MavenModule,MavenBuild> {
return
true
;
}
/**
* Information about artifacts produced by Maven.
*/
@Exported
public
MavenArtifactRecord
getMavenArtifacts
()
{
return
getAction
(
MavenArtifactRecord
.
class
);
}
/**
* Exposes {@code MAVEN_OPTS} to forked processes.
*
...
...
maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
浏览文件 @
cee86fbb
...
...
@@ -374,6 +374,14 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
return
super
.
getDynamic
(
token
,
req
,
rsp
);
}
/**
* Information about artifacts produced by Maven.
*/
@Exported
public
MavenAggregatedArtifactRecord
getMavenArtifacts
()
{
return
getAction
(
MavenAggregatedArtifactRecord
.
class
);
}
/**
* Computes the latest module builds that correspond to this build.
* (when indivudual modules are built, a new ModuleSetBuild is not created,
...
...
maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifact.java
浏览文件 @
cee86fbb
...
...
@@ -31,7 +31,7 @@ import hudson.model.BuildListener;
import
hudson.model.FingerprintMap
;
import
hudson.model.Hudson
;
import
org.apache.maven.RepositoryUtil
s
;
import
hudson.util.HttpResponse
s
;
import
org.apache.maven.artifact.Artifact
;
import
org.apache.maven.artifact.factory.ArtifactFactory
;
import
org.apache.maven.artifact.handler.ArtifactHandler
;
...
...
@@ -39,6 +39,8 @@ import org.apache.maven.artifact.handler.DefaultArtifactHandler;
import
org.apache.maven.artifact.handler.manager.ArtifactHandlerManager
;
import
com.google.common.collect.Maps
;
import
org.kohsuke.stapler.AncestorInPath
;
import
org.kohsuke.stapler.HttpResponse
;
import
org.kohsuke.stapler.export.Exported
;
import
org.kohsuke.stapler.export.ExportedBean
;
...
...
@@ -46,6 +48,7 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.Serializable
;
import
java.net.URL
;
import
java.util.Map
;
import
java.util.logging.Logger
;
...
...
@@ -101,7 +104,7 @@ public final class MavenArtifact implements Serializable {
*/
@Exported
public
final
String
md5sum
;
public
MavenArtifact
(
Artifact
a
)
throws
IOException
{
this
.
groupId
=
a
.
getGroupId
();
this
.
artifactId
=
a
.
getArtifactId
();
...
...
@@ -194,6 +197,15 @@ public final class MavenArtifact implements Serializable {
return
f
;
}
/**
* Serve the file.
*
* TODO: figure out how to make this URL more discoverable to the remote API.
*/
public
HttpResponse
doFile
(
@AncestorInPath
MavenArtifactRecord
parent
)
throws
IOException
{
return
HttpResponses
.
staticResource
(
getFile
(
parent
.
parent
));
}
private
FilePath
getArtifactArchivePath
(
MavenBuildProxy
build
,
String
groupId
,
String
artifactId
,
String
version
)
{
return
build
.
getArtifactsDir
().
child
(
groupId
).
child
(
artifactId
).
child
(
version
).
child
(
fileName
);
}
...
...
maven-plugin/src/main/resources/hudson/maven/AbstractMavenBuild/_api.jelly
0 → 100644
浏览文件 @
cee86fbb
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Simon Wiest
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<st:include page="/hudson/model/Run/_api.jelly" />
<h2>Artifact Information</h2>
<p>
<a href="../mavenArtifacts/api">Information about Maven artifacts produced by this</a> are exposed
in a machine readable form. This allows programmatic retrieval of the artifacts.
</p>
</j:jelly>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录