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; }
/** * Go through the collection of reports and put each report into a list for the appropriate category. The list is * put into a map keyed by the name of the category. * * @param reports A Collection of MavenReports * @return A map keyed category having the report itself as value */ protected Map<String, List<MavenReport>> categoriseReports( Collection<MavenReport> reports ) { Map<String, List<MavenReport>> categories = new LinkedHashMap<String, List<MavenReport>>(); for ( MavenReport report : reports ) { List<MavenReport> categoryReports = categories.get( report.getCategoryName() ); if ( categoryReports == null ) { categoryReports = new ArrayList<MavenReport>(); categories.put( report.getCategoryName(), categoryReports ); } categoryReports.add( report ); } return categories; }
item.setName( report.getName( locale ) ); item.setHref( report.getOutputName() + ".html" );
sink.link( report.getOutputName() + ".html" ); sink.text( report.getName( locale ) ); sink.link_(); sink.tableCell_(); sink.tableCell(); sink.text( report.getDescription( locale ) ); sink.tableCell_(); sink.tableRow_();
String localReportName = report.getName( locale ); report.generate( mainSink, locale ); if ( report.isExternalReport() )
/** * @param name not null * @param href not null * @param categoryReports not null * @param locale not null * @return the menu item object */ private MenuItem createCategoryMenu( String name, String href, List<MavenReport> categoryReports, Locale locale ) { MenuItem item = new MenuItem(); item.setName( name ); item.setCollapse( true ); item.setHref( href ); // MSHARED-172, allow reports to define their order in some other way? //Collections.sort( categoryReports, new ReportComparator( locale ) ); for ( MavenReport report : categoryReports ) { MenuItem subitem = new MenuItem(); subitem.setName( report.getName( locale ) ); subitem.setHref( report.getOutputName() + ".html" ); item.getItems().add( subitem ); } return item; }
/** * @param name not null * @param href not null * @param categoryReports not null * @param locale not null * @return the menu item object */ private MenuItem createCategoryMenu( String name, String href, List<MavenReport> categoryReports, Locale locale ) { MenuItem item = new MenuItem(); item.setName( name ); item.setCollapse( true ); item.setHref( href ); // MSHARED-172, allow reports to define their order in some other way? //Collections.sort( categoryReports, new ReportComparator( locale ) ); for ( MavenReport report : categoryReports ) { MenuItem subitem = new MenuItem(); subitem.setName( report.getName( locale ) ); subitem.setHref( report.getOutputName() + ".html" ); item.getItems().add( subitem ); } return item; }
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; }
String outputName = report.getOutputName() + ".html"; reportsByOutputName.put( report.getOutputName(), report ); + mavenReportExecution.getPlugin().getVersion() + ':' + mavenReportExecution.getGoal() + ')' ); getLog().info( "Skipped \"" + report.getName( locale ) + "\" report" + reportMojoInfo + ", file \"" + outputName + "\" already exists." );