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

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

commit 09e587b0fb84aee89b85c5e9ffcfd28b53676333
Author: HervĂ© Boutemy <[email protected]>
AuthorDate: Fri Dec 12 22:20:08 2025 +0900

    improve report goal log with target directory and file
---
 pom.xml                                            |  2 +-
 .../maven/reporting/AbstractMavenReport.java       | 37 +++++++++++++++-------
 2 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/pom.xml b/pom.xml
index a4e3959..77cac5e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -192,7 +192,7 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-invoker-plugin</artifactId>
         <configuration>
-          <debug>true</debug>
+          <debug>false</debug>
           <projectsDirectory>src/it</projectsDirectory>
           <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
           <preBuildHookScript>setup</preBuildHookScript>
diff --git a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java 
b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
index da7cafc..aad57e5 100644
--- a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
+++ b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
@@ -215,14 +215,18 @@ public abstract class AbstractMavenReport extends 
AbstractMojo implements MavenM
     }
 
     private void reportToMarkup() throws MojoExecutionException {
-        getLog().info("Rendering to " + outputFormat + " markup");
-
-        if (!isExternalReport()) {
-            File outputDirectory = new File(getOutputDirectory());
+        String relativeOutput =
+                
PathTool.getRelativeFilePath(String.valueOf(getProject().getBasedir()), 
getOutputDirectory());
+        if (isExternalReport()) {
+            getLog().info("Rendering external report to " + relativeOutput + 
File.separator + getOutputName());
+        } else {
             String filename = getOutputName() + '.' + outputFormat;
+            getLog().info("Rendering report as " + outputFormat + " markup to 
" + relativeOutput + File.separator
+                    + filename);
+
             try {
                 sinkFactory = container.lookup(SinkFactory.class, 
outputFormat);
-                sink = sinkFactory.createSink(outputDirectory, filename);
+                sink = sinkFactory.createSink(new File(getOutputDirectory()), 
filename);
             } catch (ComponentLookupException cle) {
                 throw new MojoExecutionException(
                         "Cannot find SinkFactory for Doxia output format: " + 
outputFormat, cle);
@@ -245,10 +249,18 @@ public abstract class AbstractMavenReport extends 
AbstractMojo implements MavenM
     }
 
     private void reportToSite() throws MojoExecutionException {
-        File outputDirectory = new File(getOutputDirectory());
-
         String filename = getOutputName() + ".html";
 
+        String relativeOutput =
+                
PathTool.getRelativeFilePath(String.valueOf(getProject().getBasedir()), 
getOutputDirectory());
+        if (isExternalReport()) {
+            getLog().info("Rendering external report to " + relativeOutput + 
File.separator + getOutputName());
+        } else {
+            getLog().info("Rendering report to " + relativeOutput + 
File.separator + filename);
+        }
+
+        File outputDirectory = new File(getOutputDirectory());
+
         Locale locale = getLocale();
 
         try {
@@ -266,8 +278,7 @@ public abstract class AbstractMavenReport extends 
AbstractMojo implements MavenM
             // TODO Compared to Maven Site Plugin multipage reports will not 
work and fail with an NPE
             generate(sink, null, locale);
 
-            if (!isExternalReport()) // MSHARED-204: only render Doxia sink if 
not an external report
-            {
+            if (!isExternalReport()) { // MSHARED-204: only render Doxia sink 
if not an external report
                 outputDirectory.mkdirs();
 
                 try (Writer writer = new OutputStreamWriter(
@@ -306,9 +317,11 @@ public abstract class AbstractMavenReport extends 
AbstractMojo implements MavenM
             Artifact skinArtifact =
                     siteTool.getSkinArtifactFromRepository(repoSession, 
remoteProjectRepositories, siteModel.getSkin());
 
-            getLog().info(buffer().a("Rendering content with ")
-                    .strong(skinArtifact.getId() + " skin")
-                    .toString());
+            if (!isExternalReport()) {
+                getLog().info(buffer().a("          using ")
+                        .strong(skinArtifact.getId() + " site skin")
+                        .toString());
+            }
 
             context = siteRenderer.createContextForSkin(
                     skinArtifact, templateProperties, siteModel, 
project.getName(), locale);

Reply via email to