Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9164547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:42:36+00:00 2026-06-17T14:42:36+00:00

I am using maven 2.2.1 and the maven-pdf-plugin to generate a PDF version of

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:42:37+00:00Added an answer on June 17, 2026 at 2:42 pm

    I found a roundabout way to accomplish this.

    I put my timezone-specific timestamp in my pom’s description tag like this:

    <description>${maven.build.timestamp}</description>
    
    <properties>
        <maven.build.timestamp.format>E dd-MMM-yyyy HH:mm z</maven.build.timestamp.format>
    </properties>
    

    Now I can tell the pdf plugin to insert this into the coverdate. My pdf.xml has this:

    <cover>
        <coverTitle>My Cover Title</coverTitle>
        <coverdate>${project.description}</coverdate>
    ...
    </cover>
    

    I now get the desired timestamp, in my local time, formatted as I want, on the PDF cover.

    Admittedly, it’s not so great to insert the timestamp into the description tag of the pom, but since I don’t use the description tag for anything else, I can live with that.

    Unfortunately, I can’t access arbitrary ${project.X} properties in the pdf.xml… only a few properties like ${project.name} and ${project.description} seem to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Created a simple Webapp using maven: mvn archetype:generate -DgroupId=com.kids -DartifactId=kidsMaven -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false My POM
I am using maven assembly plugin to generate a .tar file contain several other
So I am using Android Maven Plugin to generate apklib snapshot for one of
I am using maven-buildnumber-plugin version 1.0-beta-4. This works fine on a project checked out
Using Maven war plugin, I generate WAR which includes following directory: META-INF -- maven
I am using Maven site:run to generate a cobertura code coverage... The following is
im using maven-jaxb2-plugin to generate from a 1.0xsd file: <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <executions> <execution>
I am using maven-assembly-plugin to construct an assembly. I want to include in the
I am creating .ear using maven <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>2.6</version> <configuration> <finalName>wsformatter-ear</finalName> <includeLibInApplicationXml>true</includeLibInApplicationXml> <version>1.4</version>
Im using maven to checkout some projects. I don't want maven to checkout a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.