Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-3782

Variable substition not performed in transitive dependency using value from active profile

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 3.0-alpha-1
    • None
    • Dependencies
    • None
    • Java version: 1.6.0_07
      OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

    Description

      When invoking the 'mvn compile' command and a profile is active, defined in settings.xml, a variable substitution is not performed in a transitive dependency.

      In the example provided the project to be built, C, depends on B which in its turn depends on A. The versions of B and A to be used are defined in a profile, the POM-files defines a variable indicating the versions. The profile in question is defined in the settings.xml and is always active (check with command 'mvn help:active-profiles'). The results of project A and B are successfully built and installed in the local repository.

      Invoking a build for project C using a command line parameter indicating, 'mvn compile -Dparentversion=0.0.1-SNAPSHOT, the versions render a successful build. The transitive dependency is resolved correctly.

      This problem is also visible in Eclipse, m2eclipse, as the project C in the example provided, does not build (error indication). The example provided includes Eclipse projects displaying this (version 0.9.7.20081001-2217 of the Eclipse plugin is used).

      The settings.xml and a build log are provided as attachments to this issue.

      Attachments

        1. settings.xml
          10 kB
          Robert Varttinen
        2. MyEclipseArtifactResolver.zip
          13 kB
          Robert Varttinen
        3. MavenCli.java
          38 kB
          Robert Varttinen
        4. example.zip
          10 kB
          Robert Varttinen
        5. build.log
          19 kB
          Robert Varttinen

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            rvarttinen Robert Varttinen
            Votes:
            14 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment