mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
[FIXED JENKINS-9326] Jenkins Maven build does not recognize Tycho surfire reports
This commit is contained in:
1 parent
988b1a2014
commit
e4914db591
3 files changed
+53
-2
No files matched your search
@@ -29,6 +29,8 @@ import hudson.model.AbstractBuild;
|
||||
import hudson.model.BuildListener;
|
||||
import hudson.scm.NullSCM;
|
||||
import hudson.scm.SCM;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -42,12 +44,21 @@ import java.net.URL;
|
||||
public class ExtractResourceSCM extends NullSCM {
|
||||
private final URL zip;
|
||||
|
||||
private String parentFolder;
|
||||
|
||||
public ExtractResourceSCM(URL zip) {
|
||||
if(zip==null)
|
||||
throw new IllegalArgumentException();
|
||||
this.zip = zip;
|
||||
}
|
||||
|
||||
public ExtractResourceSCM(URL zip, String parentFolder) {
|
||||
if(zip==null)
|
||||
throw new IllegalArgumentException();
|
||||
this.zip = zip;
|
||||
this.parentFolder = parentFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, BuildListener listener, File changeLogFile) throws IOException, InterruptedException {
|
||||
if (workspace.exists()) {
|
||||
@@ -56,6 +67,12 @@ public class ExtractResourceSCM extends NullSCM {
|
||||
}
|
||||
listener.getLogger().println("Staging "+zip);
|
||||
workspace.unzipFrom(zip.openStream());
|
||||
if (parentFolder != null) {
|
||||
System.out.println("workspace " + workspace.getRemote());
|
||||
//Thread.sleep( 100000 );
|
||||
FileUtils.copyDirectory( new File(workspace.getRemote() + "/" + parentFolder), new File( workspace.getRemote()));
|
||||
//FileUtils.moveDirectory( new File(workspace.getRemote() + "/" + parentFolder), new File( workspace.getRemote()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user