提交 61a20bf1 编写于 作者: K kohsuke

make it an error for no artifact to be found when one is configured.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5748 71c3de6d-444a-0410-be80-ed276b4c234a
上级 43663a6a
......@@ -7,6 +7,7 @@ import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.Descriptor;
import hudson.model.Result;
import hudson.util.FormFieldValidator;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
......@@ -62,7 +63,11 @@ public class ArtifactArchiver extends Publisher {
dir.mkdirs();
try {
p.getWorkspace().copyRecursiveTo(artifacts,excludes,new FilePath(dir));
if(p.getWorkspace().copyRecursiveTo(artifacts,excludes,new FilePath(dir))==0) {
listener.error("No artifact founds that matches the file pattern \""+artifacts+"\". Configuration error?");
build.setResult(Result.FAILURE);
return true;
}
} catch (IOException e) {
Util.displayIOException(e,listener);
e.printStackTrace(listener.error("Failed to archive artifacts: "+artifacts));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册