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

Replacement of some maven properties is not working

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: maven-plugin
    • Labels:
      None
    • Environment:
      Maven 3.0.1, Hudson 1.394
    • Similar Issues:

      Description

      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}

        Attachments

          Issue Links

            Activity

            Hide
            olamy Olivier Lamy added a comment -

            for 1.404

            Show
            olamy Olivier Lamy added a comment - for 1.404
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            batkinson 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

            Show
            batkinson 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: