From 8f50dc457d09adb22663b44e4336b7836ff828a8 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sun, 11 Dec 2022 23:37:38 +0100 Subject: [PATCH] [MINVOKER-315] Upgrade Maven Reporting API to 3.1.1/Maven Reporting Impl to 3.2.0 This closes #155 --- pom.xml | 34 ++++++++++++++- .../maven/plugins/invoker/InvokerReport.java | 43 +++---------------- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/pom.xml b/pom.xml index 61398927..e266cf13 100644 --- a/pom.xml +++ b/pom.xml @@ -143,11 +143,23 @@ under the License. ${mavenVersion} provided + + org.apache.maven + maven-settings-builder + ${mavenVersion} + provided + + + + org.apache.maven.reporting + maven-reporting-api + 3.1.1 + org.apache.maven.reporting maven-reporting-impl - 3.1.0 + 3.2.0 org.codehaus.plexus @@ -156,6 +168,13 @@ under the License. + + + org.apache.maven.doxia + doxia-sink-api + 1.11.1 + + org.apache.maven.plugin-tools maven-plugin-annotations @@ -213,6 +232,17 @@ under the License. plexus-interpolation 1.26 + + org.codehaus.plexus + plexus-i18n + 1.0-beta-10 + + + org.codehaus.plexus + plexus-component-api + + + org.apache.maven.shared maven-shared-utils @@ -357,7 +387,7 @@ under the License. run-its - 3.7.1 + 3.12.1 diff --git a/src/main/java/org/apache/maven/plugins/invoker/InvokerReport.java b/src/main/java/org/apache/maven/plugins/invoker/InvokerReport.java index 316a6f49..71fff65f 100644 --- a/src/main/java/org/apache/maven/plugins/invoker/InvokerReport.java +++ b/src/main/java/org/apache/maven/plugins/invoker/InvokerReport.java @@ -30,13 +30,11 @@ import java.util.Locale; import org.apache.maven.doxia.sink.Sink; -import org.apache.maven.doxia.siterenderer.Renderer; import org.apache.maven.plugins.invoker.model.BuildJob; import org.apache.maven.plugins.invoker.model.io.xpp3.BuildJobXpp3Reader; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; -import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.AbstractMavenReport; import org.apache.maven.reporting.MavenReportException; import org.codehaus.plexus.i18n.I18N; @@ -58,32 +56,12 @@ public class InvokerReport extends AbstractMavenReport { - /** - * The Maven Project. - */ - @Parameter( defaultValue = "${project}", readonly = true, required = true ) - protected MavenProject project; - - /** - * Doxia Site Renderer component. - */ - @Component - protected Renderer siteRenderer; - /** * Internationalization component. */ @Component protected I18N i18n; - /** - * The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from - * the command line. If the goal is run indirectly as part of a site generation, the output directory configured in - * the Maven Site Plugin is used instead. - */ - @Parameter( defaultValue = "${project.reporting.outputDirectory}", required = true ) - protected File outputDirectory; - /** * Base directory where all build reports have been written to. */ @@ -185,6 +163,7 @@ protected void executeReport( Locale locale ) // detail tests table header sink.table(); + sink.tableRows( null, false ); sink.tableRow(); // ------------------------------------------- @@ -202,6 +181,7 @@ protected void executeReport( Locale locale ) renderBuildJob( buildJob ); } + sink.tableRows_(); sink.table_(); sink.body_(); @@ -228,6 +208,8 @@ private void constructSummarySection( List buildJobs, Locale // ------------------------------------------------------------------------ sink.table(); + sink.tableRows( null, false ); + sink.tableRow(); sinkTableHeader( sink, getText( locale, "report.invoker.summary.number" ) ); @@ -283,6 +265,8 @@ else if ( BuildJob.Result.SKIPPED.equals( buildJob.getResult() ) ) sinkCell( sink, secondsFormat.format( totalTime / number ) ); sink.tableRow_(); + + sink.tableRows_(); sink.table_(); } @@ -337,21 +321,6 @@ private String getFormattedName( String name, String description ) return nameAndDescriptionFormat.format( new Object[] { name, description } ); } - protected String getOutputDirectory() - { - return outputDirectory.getAbsolutePath(); - } - - protected MavenProject getProject() - { - return project; - } - - protected Renderer getSiteRenderer() - { - return siteRenderer; - } - public String getDescription( Locale locale ) { return getText( locale, "report.invoker.result.description" );