You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/11/28 19:15:28 UTC

[GitHub] [maven-reporting-impl] michael-o commented on a diff in pull request #13: [MSHARED-1168] support markup output

michael-o commented on code in PR #13:
URL: https://github.com/apache/maven-reporting-impl/pull/13#discussion_r1033951738


##########
pom.xml:
##########
@@ -131,6 +132,17 @@
       <artifactId>doxia-site-renderer</artifactId>
       <version>${doxiaSitetoolsVersion}</version>
     </dependency>
+    <!-- Doxia markup rendering -->
+    <dependency>
+      <groupId>org.apache.maven.doxia</groupId>
+      <artifactId>doxia-module-apt</artifactId>
+      <version>${doxiaVersion}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.doxia</groupId>
+      <artifactId>doxia-module-xdoc</artifactId>
+      <version>${doxiaVersion}</version>
+    </dependency>

Review Comment:
   Aren't these sufficient at runtime?



##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -163,6 +177,61 @@ public void execute()
             return;
         }
 
+        if ( outputFormat != null )
+        {
+            reportToMarkup();
+        }
+        else
+        {
+            reportToSite();
+        }
+    }
+
+    private void reportToMarkup()
+        throws MojoExecutionException
+    {
+        getLog().info( "rendering to " + outputFormat + " markup" );

Review Comment:
   Rendering...



##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -163,6 +177,61 @@ public void execute()
             return;
         }
 
+        if ( outputFormat != null )
+        {
+            reportToMarkup();
+        }
+        else
+        {
+            reportToSite();
+        }
+    }
+
+    private void reportToMarkup()
+        throws MojoExecutionException
+    {
+        getLog().info( "rendering to " + outputFormat + " markup" );
+
+        if ( !isExternalReport() )
+        {
+            try
+            {
+                sinkFactory = container.lookup( SinkFactory.class, outputFormat );
+                sink = sinkFactory.createSink( outputDirectory, getOutputName() + '.' + outputFormat );
+            }
+            catch ( ComponentLookupException cle )
+            {
+                throw new MojoExecutionException(
+                    "Cannot find SinkFactory for Doxia output format: " + outputFormat, cle );
+            }
+            catch ( IOException ioe )
+            {
+                throw new MojoExecutionException( "Cannot create sink to " + outputDirectory, ioe );

Review Comment:
   sink for 



##########
src/main/java/org/apache/maven/reporting/AbstractMavenReport.java:
##########
@@ -383,7 +452,10 @@ protected Skin getSkin()
      */
     protected void closeReport()
     {
-        getSink().close();
+        if ( getSink() != null )

Review Comment:
   When can the sink be `null`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org