Maven
  1. Maven
  2. MNG-5034

Wrong evaluation of {project.artifactId} variable in child POMs if included in <url> element

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 3.0.3
    • Fix Version/s: None
    • Component/s: POM
    • Labels:
      None
    • Environment:
      os: 2.6.37-gentoo; jdk "1.6.0_24"
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Suppose you have the following snippet in your parent POM:

      ...
      <artifactId>parent</artifactId>
      ...
      <url>https://intranet.xy.sk/javaweb/${project.artifactId}</url>
      <distributionManagement>
      	<site>
      		<id>site-server</id>
      		<name>Site Server</name>
      		<url>https://intranet.xy.sk/javaweb/${project.artifactId}</url>
      	</site>
      </distributionManagement>
      ...
      

      Then 'mvn help:effective-pom' command for this project will produce correct URL values:

      But, if you create a child project that declares above defined POM as a parent (and does not explicitly specify its own <url> or <distributionManagement> sections, i.e. it should inherit these sections from parent), the output from 'mvn help:effective-pom' command will contain wrong values:

        Issue Links

          Activity

          Hide
          Ivan Mrva added a comment -

          In our company, we would like to specify a project URL and distribution management section for site server only at one place - in our organization POM from which all projects inherit. This solution removes the burden from our developers, who don't need to know anything about site deployment and also should not be responsible for defining a project URLs. Currently, this can be acomplished, but only at the cost of having ugly and unpredictable project URLs.

          Show
          Ivan Mrva added a comment - In our company, we would like to specify a project URL and distribution management section for site server only at one place - in our organization POM from which all projects inherit. This solution removes the burden from our developers, who don't need to know anything about site deployment and also should not be responsible for defining a project URLs. Currently, this can be acomplished, but only at the cost of having ugly and unpredictable project URLs.

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Ivan Mrva
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: