You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2022/12/11 16:43:55 UTC

[maven-reporting-impl] 04/04: tweak markdown extension to md

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch maven-reporting-impl-3.x
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git

commit ac391db442e9b8d3e147e4b13fad7abd0a7e97b7
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sun Dec 11 17:43:48 2022 +0100

    tweak markdown extension to md
---
 src/it/use-as-direct-mojo-markup/verify.groovy                    | 2 +-
 src/main/java/org/apache/maven/reporting/AbstractMavenReport.java | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/it/use-as-direct-mojo-markup/verify.groovy b/src/it/use-as-direct-mojo-markup/verify.groovy
index 0b2b865..04dbcfd 100644
--- a/src/it/use-as-direct-mojo-markup/verify.groovy
+++ b/src/it/use-as-direct-mojo-markup/verify.groovy
@@ -23,7 +23,7 @@ File f = new File( site, 'custom-report.xdoc' );
 assert f.exists();
 assert f.text.contains( 'Custom Maven Report content.' );
 
-f = new File( site, 'custom-report-with-renderer.markdown' );
+f = new File( site, 'custom-report-with-renderer.md' );
 assert f.exists();
 assert f.text.contains( 'Custom Maven Report with Renderer content.' );
 
diff --git a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
index 0de7a4a..83d7236 100644
--- a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
+++ b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
@@ -172,14 +172,15 @@ public abstract class AbstractMavenReport
     private void reportToMarkup()
         throws MojoExecutionException
     {
-        getLog().info( "rendering to " + outputFormat + " markup" );
+        getLog().info( "Rendering to " + outputFormat + " markup" );
 
         if ( !isExternalReport() )
         {
             try
             {
                 sinkFactory = container.lookup( SinkFactory.class, outputFormat );
-                sink = sinkFactory.createSink( outputDirectory, getOutputName() + '.' + outputFormat );
+                String extension = "markdown".equals( outputFormat ) ? "md" : outputFormat; // TODO
+                sink = sinkFactory.createSink( outputDirectory, getOutputName() + '.' + extension );
             }
             catch ( ComponentLookupException cle )
             {
@@ -188,7 +189,7 @@ public abstract class AbstractMavenReport
             }
             catch ( IOException ioe )
             {
-                throw new MojoExecutionException( "Cannot create sink to " + outputDirectory, ioe );
+                throw new MojoExecutionException( "Cannot create sink for " + outputDirectory, ioe );
             }
         }