Maven 2 & 3
  1. Maven 2 & 3
  2. MNG-2782

Version property in dependencies is not expanded correctly

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Dependencies
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      The Spring poms, for example spring-beans, version 2.0.2 use the following dependencies:
      <dependency>
      <groupId>$

      {project.groupId}

      </groupId>
      <artifactId>spring-core</artifactId>
      <version>$

      {project.version}

      </version>
      </dependency>
      Which means, they are using variables in the poms. In some cases, these variables are resolved correctly, but in some cases however they are not, causing problems.

      Imho, it would be better to resolve variables for released poms to avoid any problems (or if variables are allowed, this is a maven bug then)

        Issue Links

          Activity

          Hide
          Carlos Sanchez added a comment -

          in what cases are not resolved correctly? it shouldn't be a problem

          Show
          Carlos Sanchez added a comment - in what cases are not resolved correctly? it shouldn't be a problem
          Hide
          Carsten Ziegeler added a comment -

          Yes, this works in standard scenarios. However, we have the situation in Apache Cocoon where during site generation the project version is resolved to 2.4.1 (I haven't found out where this version comes from).
          So we depend on spring-beans-2.0.2 which is resolved correctly and then Maven tries to get spring-core-2.4.1.

          Would a log with option -X perhaps help you? (It's rather long)

          Show
          Carsten Ziegeler added a comment - Yes, this works in standard scenarios. However, we have the situation in Apache Cocoon where during site generation the project version is resolved to 2.4.1 (I haven't found out where this version comes from). So we depend on spring-beans-2.0.2 which is resolved correctly and then Maven tries to get spring-core-2.4.1. Would a log with option -X perhaps help you? (It's rather long)
          Hide
          Carlos Sanchez added a comment -

          yes, please provide an example as small as possible to see the incorrect behaviour

          Show
          Carlos Sanchez added a comment - yes, please provide an example as small as possible to see the incorrect behaviour
          Show
          Grzegorz Slowikowski added a comment - Look at this: http://jira.codehaus.org/browse/MNG-2653#action_79317
          Hide
          Carsten Ziegeler added a comment -

          Thanks for the link, Grzegorz. This sounds exactly like the problem we are experiencing.
          So I think we can close this bug here.

          Show
          Carsten Ziegeler added a comment - Thanks for the link, Grzegorz. This sounds exactly like the problem we are experiencing. So I think we can close this bug here.

            People

            • Assignee:
              Unassigned
              Reporter:
              Carsten Ziegeler
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: