create a symlink from MavenModuleSetBuild to MavenBuild in the file system

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7623 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-03-12 07:27:13 +00:00
1 parent ae3df3c431
commit 351845ce3b
1 file changed
+10
@@ -4,6 +4,7 @@ import hudson.AbortException;
import hudson.FilePath;
import hudson.FilePath.FileCallable;
import hudson.Launcher;
import hudson.Util;
import hudson.maven.MavenBuild.ProxyImpl2;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
@@ -16,6 +17,7 @@ import hudson.model.Result;
import hudson.remoting.Channel;
import hudson.remoting.VirtualChannel;
import hudson.util.ArgumentListBuilder;
import hudson.util.StreamTaskListener;
import org.apache.maven.BuildFailureException;
import org.apache.maven.embedder.MavenEmbedderException;
import org.apache.maven.execution.MavenSession;
@@ -240,8 +242,16 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
getProject().updateTransientActions();
}
}
// symlink to this module build
String moduleFsName = newBuild.getProject().getModuleName().toFileSystemName();
Util.createSymlink(getRootDir(),
"../../modules/"+ moduleFsName +"/builds/"+newBuild.getId() /*ugly!*/,
moduleFsName, new StreamTaskListener());
} catch (IOException e) {
LOGGER.log(Level.WARNING,"Failed to update "+this,e);
} catch (InterruptedException e) {
LOGGER.log(Level.WARNING,"Failed to update "+this,e);
}
}