[ 
https://jira.codehaus.org/browse/MNG-5358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=311513#comment-311513
 ] 

Stephen Connolly commented on MNG-5358:
---------------------------------------

let me rephrase.

The "quick" solution was to resolve *all* properties in the pom. That breaks 
stuff.

Take for example the case where a parent pom defines a dependencyManagement, 
e.g.

{code}
<project>
   <groupId>g</groupId>
   <artifactId>a</artifactId>
   <version>1</version>
   <properties>
     <foo.version>1.0</foo.version>
   </properties>
   <dependencyManagement>
     <dependencies>
       <dependency>
         <groupId>foo</groupId>
         <artifactId>manchu</artifactId>
         <version>${foo.version}</version>
       </dependency>
       <dependency>
         <groupId>foo</groupId>
         <artifactId>bar</artifactId>
         <version>${foo.version}</version>
       </dependency>
     </dependencies>
   </dependencyManagement>
</project>
{code}

If there is then a child module *that wants to use a newer version of the foo 
dependencies* it can currently do like so:

{code}
<project>
   <parent>
     <groupId>g</groupId>
     <artifactId>a</artifactId>
     <version>1</version>
   </parent>
   <artifactId>b</artifactId>
   <properties>
     <foo.version>1.1</foo.version>
   </properties>
   <dependencies>
     <dependency>
       <groupId>foo</groupId>
       <artifactId>manchu</artifactId>
     </dependency>
     <dependency>
       <groupId>foo</groupId>
       <artifactId>bar</artifactId>
     </dependency>
   </dependencies>
</project>
{code}

Now I am not commenting on whether the above is good practice, but there are 
enough projects out there that we cannot cause the above to break, so we end up 
with the "quick" solution of deploying a fully resolved pom being unworkable as 
it would break backwards compatibility with existing projects.
                
> Install Plugin installs poms that contain variables in artifact version and 
> parent version
> ------------------------------------------------------------------------------------------
>
>                 Key: MNG-5358
>                 URL: https://jira.codehaus.org/browse/MNG-5358
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Artifacts and Repositories, Deployment
>    Affects Versions: 3.0.3
>            Reporter: Christofer Dutz
>         Attachments: module1-1.2-SNAPSHOT.pom, module2-1.2-SNAPSHOT.pom, 
> TestProject-1.2-SNAPSHOT.pom, Test.zip
>
>
> I am currently trying to create a build process that is optimized for being 
> able to have individual modules of one project deployed with different 
> versions. Therefore I created a build that uses properties for providing the 
> version numbers for artifacts, dependencies and parent relations. The build 
> is working nicely, unfortunately the install plugin installs the artifacts 
> into the correct directories, but it doesn't replace the properties. This way 
> the repo contains artifacts it can certainly not resolve ich a user checks 
> out only part of the project.
> I created a small test-project. If you simply "mvn install" it you will see 
> the problematic results.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to