Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9693

maven.build.timestamp.format is not obeyed in maven builds

    XMLWordPrintable

Details

    Description

      Since Maven 2.1 it is possible to control the format of the maven.build.timestamp property by setting the maven.build.timestamp.format property. This works correctly with mvn version 3.0.3:

      pom.xml
      <project xmlns="http://maven.apache.org/POM/4.0.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>invalid.example.test</groupId>
          <artifactId>test</artifactId>
          <version>1.0-SNAPSHOT</version>
          <packaging>jar</packaging>
          <properties>
              <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ssZ</maven.build.timestamp.format>
              <build.timestamp>${maven.build.timestamp}</build.timestamp>
          </properties>
          <build>
              <resources>
                  <resource>
                      <directory>src/main/filtered-resources</directory>
                      <filtering>true</filtering>
                  </resource>
              </resources>
          </build>
      </project>
      
      src/main/filtered-resources/test.properties
      Build-Timestamp: ${build.timestamp}
      
      target/classes/test.properties
      Build-Timestamp: 2011-05-15T18:56:20+1000
      

      but in Jenkins 1.411 the default timestamp format is used instead:

      target/classes/test.properties
      Build-Timestamp: 20110515-1857
      

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Christoph Kutzinski
            Path:
            pom.xml
            http://jenkins-ci.org/commit/maven-plugin/dae6ef31fc5152d65f5543f61f1c911fcb0dbd38
            Log:
            [Fixed JENKINS-9693] maven.build.timestamp.format is not obeyed in maven
            builds (integrate maven-interceptors 1.5)

            Compare: https://github.com/jenkinsci/maven-plugin/compare/d73f82ed2a23...dae6ef31fc51

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: pom.xml http://jenkins-ci.org/commit/maven-plugin/dae6ef31fc5152d65f5543f61f1c911fcb0dbd38 Log: [Fixed JENKINS-9693] maven.build.timestamp.format is not obeyed in maven builds (integrate maven-interceptors 1.5) Compare: https://github.com/jenkinsci/maven-plugin/compare/d73f82ed2a23...dae6ef31fc51
            jglick Jesse Glick added a comment -

            PR 839 claimed related to this.

            jglick Jesse Glick added a comment - PR 839 claimed related to this.
            jglick Jesse Glick added a comment -

            There is a commit by @kutzi claiming to fix this; should this still be open?

            jglick Jesse Glick added a comment - There is a commit by @kutzi claiming to fix this; should this still be open?

            After updating to the latest version of Jenkins, this issue appears to be fixed.

            aja4482 Anthony Agresta added a comment - After updating to the latest version of Jenkins, this issue appears to be fixed.
            danielbeck Daniel Beck added a comment -

            Comment indicates this has been resolved.

            danielbeck Daniel Beck added a comment - Comment indicates this has been resolved.

            People

              Unassigned Unassigned
              danc86 Dan C
              Votes:
              32 Vote for this issue
              Watchers:
              30 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: