I am using maven 2.2.1 and the maven-pdf-plugin to generate a PDF version of my surefire report during "mvn site".
I want to display the report (i.e. PDF) generation timestamp in the PDF itself, but in my local timezone, not in UTC. My local timezone is UTC +5:30 (IST).
Here's a snippet from the build/plugins section in my pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pdf-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>pdf</id>
<phase>site</phase>
<goals>
<goal>pdf</goal>
</goals>
<configuration>
<aggregate>true</aggregate>
<generateTOC>none</generateTOC>
<outputDirectory>${project.reporting.outputDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Here's my pdf.xml:
<document xmlns="http://maven.apache.org/DOCUMENT/1.0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DOCUMENT/1.0.1 http://maven.apache.org/xsd/document-1.0.1.xsd"
outputName="${artifactId}_surefire-report">
<meta>
<title>${artifactId} - Surefire Report</title>
<author>QA Team</author>
</meta>
<toc></toc>
<cover>
<coverTitle>TNT:${artifactId}</coverTitle>
<coverdate>${dateTime}</coverdate>
<coverSubTitle>Surefire Test Report</coverSubTitle>
<projectName>${project.name}</projectName>
</cover>
</document>
The PDF is generating fine. The problem is I want the coverdate
to be displayed in my local timezone. I've tried some of the date/time options mentioned on the Maven PDF plugin page, such as:
<coverdate>${dateTime}</coverdate>
and
<coverdate>${day}/${month}/${year} - ${hour}:${minute}:${second}</coverdate>
but the resultant timestamp is always UTC.
I also tried a few attempts like <coverdate>${dateTime+5:30}</coverdate>
but this doesn't work.
I tried to insert ${maven.build.timestamp}
(which if used in my pom is indeed in my local time) in coverdate
but this doesn't get interpolated when the PDF is generated.
How can I get the timestamp in my local time zone? I don't even need the <cover></cover>
section; I can get rid of it altogether if I can somehow get a build timestamp into the PDF.