Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MINVOKER-315] Upgrade Maven Reporting API to 3.1.1/Maven Reporting I… #155

Merged
merged 1 commit into from Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 31 additions & 1 deletion pom.xml
Expand Up @@ -143,11 +143,23 @@ under the License.
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings-builder</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>

<!-- shared -->
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
Expand All @@ -156,6 +168,13 @@ under the License.
</exclusions>
</dependency>

<!-- doxia -->
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-sink-api</artifactId>
<version>1.11.1</version>
</dependency>

<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
Expand Down Expand Up @@ -213,6 +232,17 @@ under the License.
<artifactId>plexus-interpolation</artifactId>
<version>1.26</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-i18n</artifactId>
<version>1.0-beta-10</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
Expand Down
43 changes: 6 additions & 37 deletions src/main/java/org/apache/maven/plugins/invoker/InvokerReport.java
Expand Up @@ -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;
Expand All @@ -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.
*/
Expand Down Expand Up @@ -185,6 +163,7 @@ protected void executeReport( Locale locale )

// detail tests table header
sink.table();
sink.tableRows( null, false );

sink.tableRow();
// -------------------------------------------
Expand All @@ -202,6 +181,7 @@ protected void executeReport( Locale locale )
renderBuildJob( buildJob );
}

sink.tableRows_();
sink.table_();

sink.body_();
Expand All @@ -228,6 +208,8 @@ private void constructSummarySection( List<? extends BuildJob> buildJobs, Locale
// ------------------------------------------------------------------------

sink.table();
sink.tableRows( null, false );

sink.tableRow();

sinkTableHeader( sink, getText( locale, "report.invoker.summary.number" ) );
Expand Down Expand Up @@ -283,6 +265,8 @@ else if ( BuildJob.Result.SKIPPED.equals( buildJob.getResult() ) )
sinkCell( sink, secondsFormat.format( totalTime / number ) );

sink.tableRow_();

sink.tableRows_();
sink.table_();

}
Expand Down Expand Up @@ -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" );
Expand Down