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/02/07 19:58:24 UTC

[maven-reporting-impl] branch MSHARED-1181 updated (ceb4b2d -> cdfc652)

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

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


 discard ceb4b2d  [MSHARED-1181] Populate SiteRenderingContext#getPublishDate() with ${project.build.outputTimestamp}
     add 2e38525  [MSHARED-1194] Upgrade to Doxia Sitetools 2.0.0-M5
     new cdfc652  [MSHARED-1181] Populate SiteRenderingContext#getPublishDate() with ${project.build.outputTimestamp}

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   (ceb4b2d)
            \
             N -- N -- N   refs/heads/MSHARED-1181 (cdfc652)

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[maven-reporting-impl] 01/01: [MSHARED-1181] Populate SiteRenderingContext#getPublishDate() with ${project.build.outputTimestamp}

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

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

commit cdfc6528e868306cbce52e16ba2ddd398551e7aa
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Jan 28 21:34:27 2023 +0100

    [MSHARED-1181] Populate SiteRenderingContext#getPublishDate() with ${project.build.outputTimestamp}
    
    This closes #17
---
 pom.xml                                                        |  5 +++++
 .../java/org/apache/maven/reporting/AbstractMavenReport.java   | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/pom.xml b/pom.xml
index 112eabe..7348adf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -144,6 +144,11 @@
       <artifactId>plexus-utils</artifactId>
       <version>3.5.0</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-archiver</artifactId>
+      <version>3.6.0</version>
+    </dependency>
 
     <!-- test -->
     <dependency>
diff --git a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
index d3541ae..c4a5c05 100644
--- a/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
+++ b/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java
@@ -21,6 +21,7 @@ package org.apache.maven.reporting;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.archiver.MavenArchiver;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.SinkFactory;
 import org.apache.maven.doxia.site.decoration.DecorationModel;
@@ -47,6 +48,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
@@ -256,6 +258,14 @@ public abstract class AbstractMavenReport
             throw new MavenReportException( "Failed to create context for skin", e );
         }
 
+        // Add publish date
+        String outputTimestamp = getProject().getProperties().getProperty( "project.build.outputTimestamp" );
+        MavenArchiver.parseBuildOutputTimestamp( outputTimestamp ).ifPresent( v ->
+            {
+                context.setPublishDate( Date.from( v ) );
+            }
+        );
+
         // Generate static site
         context.setRootDirectory( project.getBasedir() );