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 2023/01/28 22:36:09 UTC

[maven-reporting-impl] branch use-site.xml updated (f99656f -> ec24dc8)

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

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


    omit f99656f  [MSHARED-480] Use maven-site-plugin's site.xml to use site's skin instead of default when run as mojo
     add 936a3e4  Add TODOs
     add 6172481  [MSHARED-1182] Drop incorrect usage of SinkEventAttributeSet#BOXED
     add 9efad53  [MSHARED-1183] Don't pass implied args to AbstractMavenReportRenderer#startTable()
     add 81de0c6  [MSHARED-1184] Drop unnecessary use of type attribute with JavaScript
     add 4e85175  [MSHARED-1187] Upgrade to Doxia 2.0.0-M5
     add eb6f226  [MSHARED-1188] Upgrade to Maven Reporting API 4.0.0-M4
     add c1f6474  [MSHARED-1189] Upgrade plugins and components in ITs
     add c4b1ad4  [MSHARED-1185] Introduce AbstractMavenReportRenderer#verbatimSource()
     new ec24dc8  [MSHARED-480] Use maven-site-plugin's site.xml to use site's skin instead of default when run as mojo

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (f99656f)
            \
             N -- N -- N   refs/heads/use-site.xml (ec24dc8)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 pom.xml                                            |  5 ++--
 src/it/setup-reporting-plugin/pom.xml              |  4 +--
 .../reporting/its/custom/CustomReportRenderer.java |  4 +++
 src/it/use-as-direct-mojo/verify.groovy            | 11 ++++++--
 src/it/use-as-site-report/pom.xml                  |  4 +--
 src/it/use-as-site-report/verify.groovy            | 12 +++++++--
 .../reporting/AbstractMavenReportRenderer.java     | 29 +++++++++++++++++-----
 7 files changed, 53 insertions(+), 16 deletions(-)


[maven-reporting-impl] 01/01: [MSHARED-480] Use maven-site-plugin's site.xml to use site's skin instead of default when run as mojo

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

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

commit ec24dc86c060b4045684aeafc7c3f5da7ed7a00e
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Mon Dec 5 22:42:16 2022 +0100

    [MSHARED-480] Use maven-site-plugin's site.xml to use site's skin instead of default when run as mojo
    
    This closes #15
---
 .../maven/reporting/AbstractMavenReport.java       | 53 ++++++----------------
 1 file changed, 13 insertions(+), 40 deletions(-)

diff --git a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
index d3541ae..b55e8d2 100644
--- a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
+++ b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
@@ -24,7 +24,6 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.SinkFactory;
 import org.apache.maven.doxia.site.decoration.DecorationModel;
-import org.apache.maven.doxia.site.decoration.Skin;
 import org.apache.maven.doxia.siterenderer.Renderer;
 import org.apache.maven.doxia.siterenderer.RendererException;
 import org.apache.maven.doxia.siterenderer.RenderingContext;
@@ -86,6 +85,12 @@ public abstract class AbstractMavenReport
     @Parameter( defaultValue = "${project}", readonly = true, required = true )
     protected MavenProject project;
 
+    /**
+     * The reactor projects.
+     */
+    @Parameter( defaultValue = "${reactorProjects}", required = true, readonly = true )
+    protected List<MavenProject> reactorProjects;
+
     /**
      * Specifies the input encoding.
      */
@@ -111,21 +116,10 @@ public abstract class AbstractMavenReport
     protected List<ArtifactRepository> remoteRepositories;
 
     /**
-     * The skin to use when the report generation is invoked directly as a standalone Mojo.
-     * <p>
-     * <b>Default value is</b>:
-     * <pre>
-     * &lt;skin&gt;
-     *   &lt;groupId&gt;org.apache.maven.skins&lt;/groupId&gt;
-     *   &lt;artifactId&gt;maven-fluido-skin&lt;/artifactId&gt;
-     *   &lt;version&gt;1.11.1&lt;/version&gt;
-     * &lt;/skin&gt;
-     * </pre>
-     *
-     * @see Skin
+     * Directory containing the <code>site.xml</code> file.
      */
-    @Parameter
-    protected Skin skin;
+    @Parameter( defaultValue = "${basedir}/src/site" )
+    protected File siteDirectory;
 
     /**
      * The locale to use  when the report generation is invoked directly as a standalone Mojo.
@@ -210,7 +204,7 @@ public abstract class AbstractMavenReport
             // copy generated resources also
             getSiteRenderer().copyResources( siteContext, outputDirectory );
         }
-        catch ( RendererException | IOException | MavenReportException e )
+        catch ( RendererException | IOException | MavenReportException | SiteToolException e )
         {
             throw new MojoExecutionException(
                 "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation.", e );
@@ -218,10 +212,10 @@ public abstract class AbstractMavenReport
     }
 
     private SiteRenderingContext createSiteRenderingContext( Locale locale )
-        throws MavenReportException, IOException
+        throws MavenReportException, IOException, SiteToolException
     {
-        DecorationModel decorationModel = new DecorationModel();
-        decorationModel.setSkin( getSkin() );
+        DecorationModel decorationModel = siteTool.getDecorationModel(
+            siteDirectory, locale, project, reactorProjects, localRepository, remoteRepositories );
 
         Map<String, Object> templateProperties = new HashMap<>();
         // We tell the skin that we are rendering in standalone mode
@@ -368,27 +362,6 @@ public abstract class AbstractMavenReport
         return ( outputEncoding == null ) ? WriterFactory.UTF_8 : outputEncoding;
     }
 
-    /**
-     * Gets the skin
-     *
-     * @return the skin for this standalone report
-     */
-    protected Skin getSkin()
-    {
-        if ( skin == null )
-        {
-            Skin skin = new Skin();
-            skin.setGroupId( "org.apache.maven.skins" );
-            skin.setArtifactId( "maven-fluido-skin" );
-            skin.setVersion( "1.11.1" );
-            return skin;
-        }
-        else
-        {
-            return skin;
-        }
-    }
-
     /**
      * Gets the locale
      *