You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/11/26 20:17:29 UTC

[maven-reporting-impl] branch MSHARED-1160 created (now f6a1018)

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

michaelo pushed a change to branch MSHARED-1160
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git


      at f6a1018  [MSHARED-1160] Upgrade to Doxia/Doxia Sitetools to 2.0.0-M4

This branch includes the following new commits:

     new f6a1018  [MSHARED-1160] Upgrade to Doxia/Doxia Sitetools to 2.0.0-M4

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-reporting-impl] 01/01: [MSHARED-1160] Upgrade to Doxia/Doxia Sitetools to 2.0.0-M4

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MSHARED-1160
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git

commit f6a1018643749406844ecb48cbb5977e8858707d
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Nov 26 21:15:37 2022 +0100

    [MSHARED-1160] Upgrade to Doxia/Doxia Sitetools to 2.0.0-M4
    
    This closes #12
---
 pom.xml                                            |  4 ++--
 .../maven/reporting/AbstractMavenReport.java       | 23 +++++++++++++++++++++-
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index a3d0fec..d00b191 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,8 +70,8 @@
   <properties>
     <javaVersion>8</javaVersion>
     <mavenVersion>3.2.5</mavenVersion>
-    <doxiaVersion>2.0.0-M3</doxiaVersion>
-    <doxiaSitetoolsVersion>2.0.0-M3</doxiaSitetoolsVersion>
+    <doxiaVersion>2.0.0-M4</doxiaVersion>
+    <doxiaSitetoolsVersion>2.0.0-M4</doxiaSitetoolsVersion>
     <reportingApiVersion>4.0.0-M3</reportingApiVersion>
     <project.build.outputTimestamp>2022-07-06T20:03:31Z</project.build.outputTimestamp>
   </properties>
diff --git a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
index edc8b68..d3541ae 100644
--- a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
+++ b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
@@ -127,6 +127,17 @@ public abstract class AbstractMavenReport
     @Parameter
     protected Skin skin;
 
+    /**
+     * The locale to use  when the report generation is invoked directly as a standalone Mojo.
+     * <p>
+     * <b>Default value is</b>: {@link SiteTool#DEFAULT_LOCALE}
+     *
+     * @see SiteTool#getSiteLocales(String)
+     */
+
+    @Parameter( defaultValue = "default" )
+    protected String locale;
+
     /**
      * SiteTool.
      */
@@ -167,7 +178,7 @@ public abstract class AbstractMavenReport
 
         String filename = getOutputName() + ".html";
 
-        Locale locale = Locale.getDefault();
+        Locale locale = getLocale();
 
         try
         {
@@ -378,6 +389,16 @@ public abstract class AbstractMavenReport
         }
     }
 
+    /**
+     * Gets the locale
+     *
+     * @return the locale for this standalone report
+     */
+    protected Locale getLocale()
+    {
+        return siteTool.getSiteLocales( locale ).get( 0 );
+    }
+
     /**
      * Actions when closing the report.
      */