public boolean isSiteArchivingDisabled() { return core.isSiteArchivingDisabled(); }
public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, BuildListener listener, Throwable error) throws InterruptedException, IOException { if(!mojo.is("org.apache.maven.plugins","maven-site-plugin","site")) return true; if(build.isSiteArchivingDisabled()) { listener.getLogger().println("[JENKINS] Archiving disabled - not archiving site for " + pom.getName()); return true; } File destDir; try { destDir = mojo.getConfigurationValue("outputDirectory", File.class); } catch (ComponentConfigurationException e) { e.printStackTrace(listener.fatalError("Unable to find the site output directory")); build.setResult(Result.FAILURE); return true; } if(destDir != null && destDir.exists()) { // try to get the storage location if this is a multi-module project. final FilePath target = getModulePath(build, pom); try { listener.getLogger().printf("[JENKINS] Archiving site from %s to %s%n", destDir, target); new FilePath(destDir).copyRecursiveTo(target); } catch (IOException e) { Util.displayIOException(e,listener); e.printStackTrace(listener.fatalError("Unable to copy site from %s to %s",destDir,target)); build.setResult(Result.FAILURE); } build.registerAsAggregatedProjectAction(this); } return true; }