public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, BuildListener listener, Throwable error) throws InterruptedException, IOException { if(!(mojo.mojo instanceof MavenReport)) return true; // not a maven report MavenReport report = (MavenReport)mojo.mojo; String reportPath = report.getReportOutputDirectory().getPath(); String projectReportPath = pom.getReporting().getOutputDirectory(); if(!reportPath.startsWith(projectReportPath)) { // report is placed outside site. Can't record it. listener.getLogger().println(Messages.ReportCollector_OutsideSite(reportPath,projectReportPath)); return true; } if(action==null) action = new ReportAction(); // this is the entry point to the report File top = new File(report.getReportOutputDirectory(),report.getOutputName()+".html"); String relPath = top.getPath().substring(projectReportPath.length()); action.add(new ReportAction.Entry(relPath,report.getName(Locale.getDefault()))); return true; }
public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, BuildListener listener, Throwable error) throws InterruptedException, IOException { if(!(mojo.mojo instanceof MavenReport)) return true; // not a maven report MavenReport report = (MavenReport)mojo.mojo; String reportPath = report.getReportOutputDirectory().getPath(); String projectReportPath = pom.getReporting().getOutputDirectory(); if(!reportPath.startsWith(projectReportPath)) { // report is placed outside site. Can't record it. listener.getLogger().println(Messages.ReportCollector_OutsideSite(reportPath,projectReportPath)); return true; } if(action==null) action = new ReportAction(); // this is the entry point to the report File top = new File(report.getReportOutputDirectory(),report.getOutputName()+".html"); String relPath = top.getPath().substring(projectReportPath.length()); action.add(new ReportAction.Entry(relPath,report.getName(Locale.getDefault()))); return true; }