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

Replacement of some maven properties is not working

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None
    • Maven 3.0.1, Hudson 1.394

      Steps to reproduce:

      0. Create a simple maven 3 project
      1. Enable Resource Filtering
      2. Add a resource file with this content:
      SERVER_VERSION=${project.version}
      SERVER_BUILD_DATE=${timestamp}

      3. Add a property to the pom (to work around http://jira.codehaus.org/browse/MRESOURCES-99)
      <properties>
      <timestamp>${maven.build.timestamp}</timestamp>
      </properties>

      4. Executing mvn help:effective-pom shows

      • The WRONG Result on hudson: .... <timestamp>${maven.build.timestamp}</timestamp> ....
      • The correct Result when you run it on a local machine: <timestamp>20110121-1512</timestamp>

      5. Because of the behavior described in step 4 the resource filtering is not working as expected:
      SERVER_VERSION=2.3.0-SNAPSHOT
      SERVER_BUILD_DATE=${maven.build.timestamp}

          [JENKINS-8573] Replacement of some maven properties is not working

          Olivier Lamy added a comment -

          I disagree on the some maven properties, I should say only this one

          Olivier Lamy added a comment - I disagree on the some maven properties, I should say only this one

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          maven3-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java
          http://jenkins-ci.org/commit/maven-interceptors/d4f8020ad40f0ad5b715e083981b1d63cd518664
          Log:
          [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: maven3-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java http://jenkins-ci.org/commit/maven-interceptors/d4f8020ad40f0ad5b715e083981b1d63cd518664 Log: [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          dogfood added a comment -

          Integrated in maven-interceptors #4
          [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          Olivier Lamy :
          Files :

          • maven3-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java

          dogfood added a comment - Integrated in maven-interceptors #4 [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build Olivier Lamy : Files : maven3-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          maven-plugin/pom.xml
          maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java
          test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
          test/src/test/java/hudson/maven/Maven3BuildTest.java
          test/src/test/java/hudson/maven/MavenBuildTest.java
          http://jenkins-ci.org/commit/jenkins/f0dde2457e3e10a98efa6187073d164220789ba6
          Log:
          [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: maven-plugin/pom.xml maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java test/src/test/java/hudson/maven/Maven3BuildTest.java test/src/test/java/hudson/maven/MavenBuildTest.java http://jenkins-ci.org/commit/jenkins/f0dde2457e3e10a98efa6187073d164220789ba6 Log: [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          dogfood added a comment -

          Integrated in jenkins_main_trunk #602
          [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          Olivier Lamy : f0dde2457e3e10a98efa6187073d164220789ba6
          Files :

          • maven-plugin/pom.xml
          • test/src/test/java/hudson/maven/Maven3BuildTest.java
          • maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java
          • test/src/test/java/hudson/maven/MavenBuildTest.java
          • test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java

          dogfood added a comment - Integrated in jenkins_main_trunk #602 [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build Olivier Lamy : f0dde2457e3e10a98efa6187073d164220789ba6 Files : maven-plugin/pom.xml test/src/test/java/hudson/maven/Maven3BuildTest.java maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java test/src/test/java/hudson/maven/MavenBuildTest.java test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java

          Olivier Lamy added a comment -

          for 1.404

          Olivier Lamy added a comment - for 1.404

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          maven-plugin/pom.xml
          maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java
          test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
          test/src/test/java/hudson/maven/Maven3BuildTest.java
          test/src/test/java/hudson/maven/MavenBuildTest.java
          http://jenkins-ci.org/commit/jenkins/f0dde2457e3e10a98efa6187073d164220789ba6
          Log:
          [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: maven-plugin/pom.xml maven-plugin/src/main/java/hudson/maven/RedeployPublisher.java test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java test/src/test/java/hudson/maven/Maven3BuildTest.java test/src/test/java/hudson/maven/MavenBuildTest.java http://jenkins-ci.org/commit/jenkins/f0dde2457e3e10a98efa6187073d164220789ba6 Log: [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          Brent Atkinson added a comment - - edited

          This only works for builds not using maven.build.timestamp.format since the pattern used is hard-coded. Is there a reason that we couldn't use the format if specified here? https://github.com/jenkinsci/maven-interceptors/commit/d4f8020ad40f0ad5b715e083981b1d63cd518664#L0R92

          Brent Atkinson added a comment - - edited This only works for builds not using maven.build.timestamp.format since the pattern used is hard-coded. Is there a reason that we couldn't use the format if specified here? https://github.com/jenkinsci/maven-interceptors/commit/d4f8020ad40f0ad5b715e083981b1d63cd518664#L0R92

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          pom.xml
          src/main/java/hudson/maven/RedeployPublisher.java
          http://jenkins-ci.org/commit/maven-plugin/461d2dd6fad6d065e80387d4c1ba1676f687b64d
          Log:
          [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          Originally-Committed-As: f0dde2457e3e10a98efa6187073d164220789ba6

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: pom.xml src/main/java/hudson/maven/RedeployPublisher.java http://jenkins-ci.org/commit/maven-plugin/461d2dd6fad6d065e80387d4c1ba1676f687b64d Log: [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build Originally-Committed-As: f0dde2457e3e10a98efa6187073d164220789ba6

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
          http://jenkins-ci.org/commit/jenkins-test-harness/76fc9f3e1f85667022f53cec7afa9be9c03a1c67
          Log:
          [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build

          Originally-Committed-As: f0dde2457e3e10a98efa6187073d164220789ba6

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java http://jenkins-ci.org/commit/jenkins-test-harness/76fc9f3e1f85667022f53cec7afa9be9c03a1c67 Log: [FIXED JENKINS-8573] maven.build.timestamp property is not available during maven build Originally-Committed-As: f0dde2457e3e10a98efa6187073d164220789ba6

            olamy Olivier Lamy
            fex_14 fex_14
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: