You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Varttinen (JIRA)" <ji...@codehaus.org> on 2008/10/07 13:39:08 UTC

[jira] Created: (MNG-3782) Variable substition not performed in transitive dependency using value from active profile

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

                 Key: MNG-3782
                 URL: http://jira.codehaus.org/browse/MNG-3782
             Project: Maven 2
          Issue Type: Bug
          Components: Dependencies
    Affects Versions: 2.0.9
         Environment: Java version: 1.6.0_07
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
            Reporter: Robert Varttinen
         Attachments: build.log, example.zip, settings.xml

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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3782) [regression] Variable substition not performed in transitive dependency using value from active profile

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated MNG-3782:
------------------------------

    Affects Version/s:     (was: 2.0.9)
                       3.0-alpha-1
        Fix Version/s: 3.0-alpha-3
              Summary: [regression] Variable substition not performed in transitive dependency using value from active profile  (was: Variable substition not performed in transitive dependency using value from active profile)

profiles are currently not working completely in the version embedded in eclipse

> [regression] Variable substition not performed in transitive dependency using value from active profile
> -------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.0-alpha-1
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>             Fix For: 3.0-alpha-3
>
>         Attachments: build.log, example.zip, MavenCli.java, MyEclipseArtifactResolver.zip, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3782) [regression] Variable substition not performed in transitive dependency using value from active profile

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason van Zyl updated MNG-3782:
-------------------------------

    Fix Version/s:     (was: 3.0-alpha-3)
                   3.0-alpha-4

> [regression] Variable substition not performed in transitive dependency using value from active profile
> -------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.0-alpha-1
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>             Fix For: 3.0-alpha-4
>
>         Attachments: build.log, example.zip, MavenCli.java, MyEclipseArtifactResolver.zip, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3782) Variable substition not performed in transitive dependency using value from active profile

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-3782:
-----------------------------------

    Fix Version/s:     (was: 3.0-alpha-5)
                   3.x

> Variable substition not performed in transitive dependency using value from active profile
> ------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.0-alpha-1
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>             Fix For: 3.x
>
>         Attachments: build.log, example.zip, MavenCli.java, MyEclipseArtifactResolver.zip, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3782) [regression] Variable substition not performed in transitive dependency using value from active profile

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason van Zyl updated MNG-3782:
-------------------------------

    Fix Version/s:     (was: 3.0-alpha-4)
                   3.0-alpha-3

> [regression] Variable substition not performed in transitive dependency using value from active profile
> -------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.0-alpha-1
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>             Fix For: 3.0-alpha-3
>
>         Attachments: build.log, example.zip, MavenCli.java, MyEclipseArtifactResolver.zip, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MNG-3782) Variable substition not performed in transitive dependency using value from active profile

Posted by "Robert Varttinen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=152269#action_152269 ] 

rvarttinen edited comment on MNG-3782 at 10/29/08 7:34 AM:
-----------------------------------------------------------------

The uploaded file (MavenCli.java) has an altered version of MavenCli, it has a piece of code added to a section of the main(...) method. The "patch" passed the properties of an active profile to the system properties. Thus, in our case, we get a variable substitution performed accordingly. This can, however, also be performed by passing the properties in question using the '-D..' option on the command line. This might be a problem though when invoked from an automatic build tool. 


      was (Author: rvarttinen):
    This is an altered version of MavenCli, it has a piece of code added to a section of the main(...) method. The "patch" passed the properties of an active profile to the system properties. Thus, in our case, we get a variable substitution performed accordingly. This can, however, also be performed by passing the properties in question using the '-D..' option on the command line. This might be a problem though when invoked from an automatic build tool. 

  
> Variable substition not performed in transitive dependency using value from active profile
> ------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.9
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>         Attachments: build.log, example.zip, MavenCli.java, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3782) Variable substition not performed in transitive dependency using value from active profile

Posted by "Robert Varttinen (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Varttinen updated MNG-3782:
----------------------------------

    Attachment: MyEclipseArtifactResolver.zip

Attaching a patch, addition, to m2eclipse that performs the desired result. This alteration of the code is a bit more complicated and involves two classes: 
- MavenProjectManagerImpl, pointing out MyEclipseArtifactResolver for instantiation instead of EclipseArtifactResolver 
- MyEclipseArtifactResolver with an additional method doing the variable substation prior to resolving the artifact in question. 

Please keep in mind that the solution in m2eclispe we have presented works for substituting variables appearing in group- or artifactId and version of an artifact to be resolved. It is not as generic as the Maven CLI patch. For us in our current project it works fine as we are about work with POM:s with variables in version fields. Somebody taking a look at this might very well find a much better, and more generic, way of doing substitution. 

> Variable substition not performed in transitive dependency using value from active profile
> ------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.9
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>         Attachments: build.log, example.zip, MavenCli.java, MyEclipseArtifactResolver.zip, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-3782) [regression] Variable substition not performed in transitive dependency using value from active profile

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=158810#action_158810 ] 

Brett Porter commented on MNG-3782:
-----------------------------------

agreed - I've regularly recommended not to use properties to affect values inside a dependency for this reason, and even in 2.0.x they work inconsistently.

> [regression] Variable substition not performed in transitive dependency using value from active profile
> -------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.0-alpha-1
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>             Fix For: 3.0-alpha-3
>
>         Attachments: build.log, example.zip, MavenCli.java, MyEclipseArtifactResolver.zip, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-3782) [regression] Variable substition not performed in transitive dependency using value from active profile

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=158787#action_158787 ] 

Jason van Zyl commented on MNG-3782:
------------------------------------

I don't think this is even a good idea. Beyond your project, or reactor, influencing variable interpolation in transitive projects is probably not something we want to allow.

> [regression] Variable substition not performed in transitive dependency using value from active profile
> -------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.0-alpha-1
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>             Fix For: 3.0-alpha-3
>
>         Attachments: build.log, example.zip, MavenCli.java, MyEclipseArtifactResolver.zip, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3782) Variable substition not performed in transitive dependency using value from active profile

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason van Zyl updated MNG-3782:
-------------------------------

    Fix Version/s:     (was: 3.0-alpha-3)
                   3.0-alpha-5
          Summary: Variable substition not performed in transitive dependency using value from active profile  (was: [regression] Variable substition not performed in transitive dependency using value from active profile)

> Variable substition not performed in transitive dependency using value from active profile
> ------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.0-alpha-1
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>             Fix For: 3.0-alpha-5
>
>         Attachments: build.log, example.zip, MavenCli.java, MyEclipseArtifactResolver.zip, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MNG-3782) Variable substition not performed in transitive dependency using value from active profile

Posted by "Robert Varttinen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=152274#action_152274 ] 

rvarttinen edited comment on MNG-3782 at 10/29/08 8:03 AM:
-----------------------------------------------------------------

Attaching a patch (MyEclipseArtifactResolver.zip), addition, to m2eclipse that performs the desired result. This alteration of the code is a bit more complicated and involves two classes: 
- MavenProjectManagerImpl, pointing out MyEclipseArtifactResolver for instantiation instead of EclipseArtifactResolver 
- MyEclipseArtifactResolver with an additional method doing the variable substation prior to resolving the artifact in question. 

Please keep in mind that the solution in m2eclispe we have presented works for substituting variables appearing in group- or artifactId and version of an artifact to be resolved. It is not as generic as the Maven CLI patch. For us in our current project it works fine as we are about work with POM:s with variables in version fields. Somebody taking a look at this might very well find a much better, and more generic, way of doing substitution. 

      was (Author: rvarttinen):
    Attaching a patch, addition, to m2eclipse that performs the desired result. This alteration of the code is a bit more complicated and involves two classes: 
- MavenProjectManagerImpl, pointing out MyEclipseArtifactResolver for instantiation instead of EclipseArtifactResolver 
- MyEclipseArtifactResolver with an additional method doing the variable substation prior to resolving the artifact in question. 

Please keep in mind that the solution in m2eclispe we have presented works for substituting variables appearing in group- or artifactId and version of an artifact to be resolved. It is not as generic as the Maven CLI patch. For us in our current project it works fine as we are about work with POM:s with variables in version fields. Somebody taking a look at this might very well find a much better, and more generic, way of doing substitution. 
  
> Variable substition not performed in transitive dependency using value from active profile
> ------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.9
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>         Attachments: build.log, example.zip, MavenCli.java, MyEclipseArtifactResolver.zip, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3782) Variable substition not performed in transitive dependency using value from active profile

Posted by "Robert Varttinen (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Varttinen updated MNG-3782:
----------------------------------

    Attachment: MavenCli.java

This is an altered version of MavenCli, it has a piece of code added to a section of the main(...) method. The "patch" passed the properties of an active profile to the system properties. Thus, in our case, we get a variable substitution performed accordingly. This can, however, also be performed by passing the properties in question using the '-D..' option on the command line. This might be a problem though when invoked from an automatic build tool. 


> Variable substition not performed in transitive dependency using value from active profile
> ------------------------------------------------------------------------------------------
>
>                 Key: MNG-3782
>                 URL: http://jira.codehaus.org/browse/MNG-3782
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.9
>         Environment: Java version: 1.6.0_07
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>            Reporter: Robert Varttinen
>         Attachments: build.log, example.zip, MavenCli.java, settings.xml
>
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira