Uploaded image for project: 'Maven Site Plugin'
  1. Maven Site Plugin
  2. MSITE-971

Site generation not resolving git.commit.time

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.0-M9
    • 4.0.0-M10, 4.0.0
    • property interpolation
    • None
    • Windows 10 and FreeBSD

    Description

      I'm using git-commit-id-maven-plugin to set project.build.outputTimestamp as suggested in the Maven Guide Configuring for Reproducible Builds. I've included the plugin in my pom and including the following property definition:

       

      <project.build.outputTimestamp>${git.commit.time}</project.build.outputTimestamp>

       

      When I generate the site, the plugin fails with the message:

      site failed: Invalid project.build.outputTimestamp value '${git.commit.time}

      This configuration works properly in the maven-jar-plugin, so I did some investigation. The jar plugin is getting the outputTimestamp as a mojo parameter:

       

      @Parameter( defaultValue = "${project.build.outputTimestamp}" )
      private String outputTimestamp;
      

      This works properly, with outputTimestamp set to the last commit time.

      In the site-plugin code, the outputTimestamp is being pulled from the project properties:

      String outputTimestamp = p.getProperties().getProperty("project.build.outputTimestamp");

      In the case the property hasn't been resolved and the returned string is ${git.commit.time}.

       

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              larrick Brad Larrick
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: