You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jeremie Poutrin (JIRA)" <ji...@codehaus.org> on 2006/07/14 17:09:19 UTC

[jira] Created: (MNG-2446) parent Pom properties not resolved for module dependencies

parent Pom  properties not resolved for module dependencies
-----------------------------------------------------------

         Key: MNG-2446
         URL: http://jira.codehaus.org/browse/MNG-2446
     Project: Maven 2
        Type: Bug

  Components: Dependencies  
    Versions: 2.0.4    
 Environment: WindowsXP/Linux - JDK 1.4 last version
    Reporter: Jeremie Poutrin
    Priority: Minor


root-project --> root-pom.xml   with <version>${my.version}</version>
|------->proj1 <parent><version>${my.version}</version></parent>
|------->proj2 <parent><version>${my.version}</version></parent>
|               |
|               |->proj1 dependency
|------->proj3 <parent><version>${my.version}</version></parent>

if I compile from the root-project directory, all compile fine.

if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
resolve proj1-${my.version}
but tries to resolve the parent version root-project-${my.version} but this is not resolved.




-- 
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-2446) parent Pom properties not resolved for module dependencies

Posted by "Abhishekh Padmanbhan (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=210446#action_210446 ] 

Abhishekh Padmanbhan edited comment on MNG-2446 at 2/17/10 9:18 AM:
--------------------------------------------------------------------

I think I might have a workaround/solution to this problem using a profiles.xml (MAVEN 2.1.0) in the root project that holds the project current version as a property. This property then can be used as a value to the version in the parent tag definition in all its sub modules.


Find below the workaround that I use to propagate the project version variable as a property to all of the project submodule. By doing this I avoid having to redefine the project parent pom version in all its submodules.

*PROJECT STRUCTURE (all caps are modules)*

ROOT
 - pom.xml
 - profiles.xml
 - WAR
   -- pom.xml
 - EJB
   -- pom.xml

*ROOT/profiles.xml*

{noformat}
<profilesXml>
<profiles>
    <profile>
      <id>projectProfile</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
         <currentVersion>1.0.1</currentVersion>
      </properties>
    </profile>
</profiles>
</profilesXml>
{noformat}

*ROOT/pom.xml*

{noformat}
<project>
  <groupId>projGrp</groupId>
  <artifactId>rootProjName</artifactId>
  <version>${currentVersion}</version>
</project>
{noformat}

*ROOT/EJB/pom.xml*

{noformat}
<project>
  <artifactId>ejbProjName</artifactId>
  <packaging>ejb</packaging>
  <parent>
	<groupId>projGrp</groupId>
	<artifactId>rootProjName</artifactId>
	<version>${currentVersion}</version>
  </parent>
</project>
{noformat}

I think this way the project version is a property just in one file profiles.xml in the ROOT project and will be the only file that changes when the version changes.

I have not tested this exhaustively but seems to work in principle.

      was (Author: abhishekhp):
    I think I might have a workaround/solution to this problem using a profiles.xml (MAVEN 2.1.0) in the root project that holds the project current version as a property. This property then can be used as a value to the version in the parent tag definition in all its sub modules.


Find below the workaround that I use to propagate the project version variable as a property to all of the project submodule. By doing this I avoid having to redefine the project parent pom version in all its submodules.

*PROJECT STRUCTURE (all caps are modules)*

ROOT
 - pom.xml
 - profiles.xml
 - WAR
   -- pom.xml
 - EJB
   -- pom.xml

*profiles.xml*

{noformat}
<profilesXml>
<profiles>
    <profile>
      <id>projectProfile</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
         <currentVersion>1.0.1</currentVersion>
      </properties>
    </profile>
</profiles>
</profilesXml>
{noformat}

*ROOT/pom.xml*

{noformat}
<project>
  <groupId>projGrp</groupId>
  <artifactId>rootProjName</artifactId>
  <version>${currentVersion}</version>
</project>
{noformat}

*ROOT/EJB/pom.xml*

{noformat}
<project>
  <artifactId>ejbProjName</artifactId>
  <packaging>ejb</packaging>
  <parent>
	<groupId>projGrp</groupId>
	<artifactId>rootProjName</artifactId>
	<version>${currentVersion}</version>
  </parent>
</project>
{noformat}

I think this way the project version is a property just in one file profiles.xml in the ROOT project and will be the only file that changes when the version changes.

I have not tested this exhaustively but seems to work in principle.
  
> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Assignee: Brett Porter
>            Priority: Minor
>         Attachments: InstallMojo.quoteReplacement.patch, maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=152287#action_152287 ] 

henrik242 edited comment on MNG-2446 at 10/29/08 9:32 AM:
-------------------------------------------------------------------------

Sorry, I uploaded   [^InstallMojo.quoteReplacement.patch]  by a mistake.  It should have been attached to MNG-3057.  

      was (Author: henrik242):
    Here's a quick fix for the Illegal group reference bug (nested properties): [^InstallMojo.quoteReplacement.patch] 
  
> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Priority: Minor
>             Fix For: Reviewed Pending Version Assignment
>
>         Attachments: InstallMojo.quoteReplacement.patch, maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

Posted by "Abhishekh Padmanbhan (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=210446#action_210446 ] 

Abhishekh Padmanbhan commented on MNG-2446:
-------------------------------------------

I think I might have a workaround/solution to this problem using a profiles.xml (MAVEN 2.1.0) in the root project that holds the project current version as a property. This property then can be used as a value to the version in the parent tag definition in all its sub modules.


Find below the workaround that I use to propagate the project version variable as a property to all of the project submodule. By doing this I avoid having to redefine the project parent pom version in all its submodules.

*PROJECT STRUCTURE (all caps are modules)*

ROOT
 - pom.xml
 - profiles.xml
 - WAR
   -- pom.xml
 - EJB
   -- pom.xml

*profiles.xml*

{noformat}
<profilesXml>
<profiles>
    <profile>
      <id>projectProfile</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
         <currentVersion>1.0.1</currentVersion>
      </properties>
    </profile>
</profiles>
</profilesXml>
{noformat}

*ROOT/pom.xml*

{noformat}
<project>
  <groupId>projGrp</groupId>
  <artifactId>rootProjName</artifactId>
  <version>${currentVersion}</version>
</project>
{noformat}

*ROOT/EJB/pom.xml*

{noformat}
<project>
  <artifactId>ejbProjName</artifactId>
  <packaging>ejb</packaging>
  <parent>
	<groupId>projGrp</groupId>
	<artifactId>rootProjName</artifactId>
	<version>${currentVersion}</version>
  </parent>
</project>
{noformat}

I think this way the project version is a property just in one file profiles.xml in the ROOT project and will be the only file that changes when the version changes.

I have not tested this exhaustively but seems to work in principle.

> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Assignee: Brett Porter
>            Priority: Minor
>         Attachments: InstallMojo.quoteReplacement.patch, maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139953#action_139953 ] 

henrik242 edited comment on MNG-2446 at 6/30/08 5:32 AM:
------------------------------------------------------------------------

This issue should definately have a _major_ priority.  I have the same problem, and I have  attached a test case (see [^maven-version-problem.zip]):

{code}
first-+-second---third
      |
      +-fourth
{code}

Fourth depends on third.  Doing a {{mvn clean install}}  from root works fine. Doing the same within the {{fourth}} module fails to resolve the {{second}} artifact:

{code}
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: me
ArtifactId: second
Version: ${applicationVersion}
{code}

The problem is in the install plugin.  It creates pom files in the repository with an unparsed <version>:
{code}
$ cat ~/.m2/repository/me/second/1.0/second-1.0.pom 
<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>me</groupId>
    <artifactId>second</artifactId>
    <name>Second</name>
    <packaging>pom</packaging>
    
    <modules>
      <module>third</module>
    </modules>

    <parent>
        <groupId>me</groupId>
        <artifactId>first</artifactId>
        <version>${applicationVersion}</version> 
        <relativePath>../pom.xml</relativePath>
    </parent>
</project>
{code}
If I replace {{${applicationVersion}}} with {{1.0}} in this file, the {{fourth}} module builds fine on itself.


      was (Author: henrik242):
    I have the same problem, and I have  attached a test case (see [^maven-version-problem.zip]):
{code}
first-+-second---third
      |
      +-fourth
{code}

Fourth depends on third.  Doing a {{mvn clean install}}  from root works fine. Doing the same within the {{fourth}} module fails to resolve the {{second}} artifact:

{code}
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: me
ArtifactId: second
Version: ${applicationVersion}
{code}

The problem is in the install plugin.  It creates pom files in the repository with an unparsed <version>:
{code}
$ cat ~/.m2/repository/me/second/1.0/second-1.0.pom 
<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>me</groupId>
    <artifactId>second</artifactId>
    <name>Second</name>
    <packaging>pom</packaging>
    
    <modules>
      <module>third</module>
    </modules>

    <parent>
        <groupId>me</groupId>
        <artifactId>first</artifactId>
        <version>${applicationVersion}</version> 
        <relativePath>../pom.xml</relativePath>
    </parent>
</project>
{code}
If I replace {{${applicationVersion}}} with {{1.0}} in this file, the {{fourth}} module builds fine on itself.

  
> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Priority: Minor
>             Fix For: Reviewed Pending Version Assignment
>
>         Attachments: maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139953#action_139953 ] 

henrik242 edited comment on MNG-2446 at 6/30/08 5:30 AM:
------------------------------------------------------------------------

I have the same problem, and I have  attached a test case (see [^maven-version-problem.zip]):
{code}
first-+-second---third
      |
      +-fourth
{code}

Fourth depends on third.  Doing a {{mvn clean install}}  from root works fine. Doing the same within the {{fourth}} module fails to resolve the {{second}} artifact:

{code}
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: me
ArtifactId: second
Version: ${applicationVersion}
{code}

The problem is in the install plugin.  It creates pom files in the repository with an unparsed <version>:
{code}
$ cat ~/.m2/repository/me/second/1.0/second-1.0.pom 
<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>me</groupId>
    <artifactId>second</artifactId>
    <name>Second</name>
    <packaging>pom</packaging>
    
    <modules>
      <module>third</module>
    </modules>

    <parent>
        <groupId>me</groupId>
        <artifactId>first</artifactId>
        <version>${applicationVersion}</version> 
        <relativePath>../pom.xml</relativePath>
    </parent>
</project>
{code}
If I replace {{${applicationVersion}}} with {{1.0}} in this file, the {{fourth}} module builds fine on itself.


      was (Author: henrik242):
    I have the same problem, and I have  attached a test case (see [^maven-version-problem.zip]):
{code}
first-+-second---third
      |
      +-fourth
{code}

Fourth depends on third.  Doing a {{mvn clean install}}  from root works fine. Doing the same within the {{fourth}} module fails to resolve the {{second}} artifact:

{code}
INFO] Using default encoding to copy filtered resources.
Downloading: http://repo1.maven.org/maven2/me/second/${applicationVersion}/second-${applicationVersion}.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
{code}

The problem is in the install plugin.  It creates pom files in the repository with an unparsed <version>:
{code}
$ cat ~/.m2/repository/me/second/1.0/second-1.0.pom 
<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>me</groupId>
    <artifactId>second</artifactId>
    <name>Second</name>
    <packaging>pom</packaging>
    
    <modules>
      <module>third</module>
    </modules>

    <parent>
        <groupId>me</groupId>
        <artifactId>first</artifactId>
        <version>${applicationVersion}</version> 
        <relativePath>../pom.xml</relativePath>
    </parent>
</project>
{code}
If I replace {{${applicationVersion}}} with {{1.0}} in this file, the {{fourth}} module builds fine on itself.

  
> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Priority: Minor
>             Fix For: Reviewed Pending Version Assignment
>
>         Attachments: maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

Posted by "Hans Dockter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_93309 ] 

Hans Dockter commented on MNG-2446:
-----------------------------------

I think this is an major issue.

We have a complex build where we have poms that declare the modules and other poms that are used for inheritance.

- api
-- pom.xml (Module declaration)
-- apibasepomDir
--- api-base-pom
-- someprojectDir
--- pom <-- api-base-pom
-- servicesDir
--- pom.xml (Further module declaration)
--- servicesbasepom
---- services-base-pom <-- api-base-pom
--- someServiceDir
---- pom <-- services-base-pom

We want one and only one definition of the version.

We do this via properties. In the api-base-pom, which is the parent of every project except the poms declaring the modules, we set a property:
{code:xml}
<properties>
     <krugle.api.version>1.0-SNAPSHOT</krugle.api.version>
 </properties>
{code}

This property is available for all projects that inherit from api-base-pom as well as for api-base-pom itself.

So we can use something like:

{code:xml}
<parent>
      <groupId>x</groupId>
      <artifactId>api-base-pom</artifactId>
      <version>${api.version}</version>
</parent>
{code}

The problem is that the pom declaring the modules don't inherit from the api-base-pom. It would be anyway more intuitive to set the version property in the pom of the api folder, as this is the first one parsed for a build. But if we set the property there, it is only applicable within this pom. So we end up with a situation where we have to define the version property 3 times. We have to separate the pom's declaring the modules from the base-poms used for inheritance, to avoid cyclic references and to trigger certain packaging instructions at the right phase of the build.

What works is to set the version property via mvn install -D...

But the version property should be part of the pom, no question about this.

Basically I want to be able to declare a property that is available for all poms within the module build, regardless of inheritance relationships.


> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Priority: Minor
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

Posted by "Paul Bakker (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=137460#action_137460 ] 

Paul Bakker commented on MNG-2446:
----------------------------------

I agree this is a major issue. We use the exact same mechanism as described by Hans, and run into the same problem. 

> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Priority: Minor
>             Fix For: Reviewed Pending Version Assignment
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139953#action_139953 ] 

henrik242 edited comment on MNG-2446 at 6/30/08 5:28 AM:
------------------------------------------------------------------------

I have the same problem, and I have  attached a test case (see [^maven-version-problem.zip]):
{code}
first-+-second---third
      |
      +-fourth
{code}

Fourth depends on third.  Doing a {{mvn clean install}}  from root works fine. Doing the same within the {{fourth}} module fails to resolve the {{second}} artifact:

{code}
INFO] Using default encoding to copy filtered resources.
Downloading: http://repo1.maven.org/maven2/me/second/${applicationVersion}/second-${applicationVersion}.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
{code}

The problem is in the install plugin.  It creates pom files in the repository with an unparsed <version>:
{code}
$ cat ~/.m2/repository/me/second/1.0/second-1.0.pom 
<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>me</groupId>
    <artifactId>second</artifactId>
    <name>Second</name>
    <packaging>pom</packaging>
    
    <modules>
      <module>third</module>
    </modules>

    <parent>
        <groupId>me</groupId>
        <artifactId>first</artifactId>
        <version>${applicationVersion}</version> 
        <relativePath>../pom.xml</relativePath>
    </parent>
</project>
{code}
If I replace {{${applicationVersion}}} with {{1.0}} in this file, the {{fourth}} module builds fine on itself.


      was (Author: henrik242):
    I have the same problem, and I have  attached a test case (see maven-version-problem.zip):
{code}
first-+-second---third
      |
      +-fourth
{code}

Fourth depends on third.  Doing a {{mvn clean install}}  from root works fine. Doing the same within the {{fourth}} module fails to resolve the {{second}} artifact:

{code}
INFO] Using default encoding to copy filtered resources.
Downloading: http://repo1.maven.org/maven2/me/second/${applicationVersion}/second-${applicationVersion}.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
{code}

The problem is in the install plugin.  It creates pom files in the repository with an unparsed <version>:
{code}
$ cat ~/.m2/repository/me/second/1.0/second-1.0.pom 
<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>me</groupId>
    <artifactId>second</artifactId>
    <name>Second</name>
    <packaging>pom</packaging>
    
    <modules>
      <module>third</module>
    </modules>

    <parent>
        <groupId>me</groupId>
        <artifactId>first</artifactId>
        <version>${applicationVersion}</version> 
        <relativePath>../pom.xml</relativePath>
    </parent>
</project>
{code}
If I replace ${applicationVersion} to 1.0 in this file, the {{fourth}} module builds fine on itself.

  
> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Priority: Minor
>             Fix For: Reviewed Pending Version Assignment
>
>         Attachments: maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

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

Henrik Brautaset Aronsen updated MNG-2446:
------------------------------------------

    Attachment: InstallMojo.quoteReplacement.patch

Here's a quick fix for the Illegal group reference bug (nested properties): [^InstallMojo.quoteReplacement.patch] 

> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Priority: Minor
>             Fix For: Reviewed Pending Version Assignment
>
>         Attachments: InstallMojo.quoteReplacement.patch, maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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] Closed: (MNG-2446) parent Pom properties not resolved for module dependencies

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

Brett Porter closed MNG-2446.
-----------------------------

         Assignee: Brett Porter
       Resolution: Duplicate
    Fix Version/s:     (was: Reviewed Pending Version Assignment)

I believe this is covered by the linked issues.

> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Assignee: Brett Porter
>            Priority: Minor
>         Attachments: InstallMojo.quoteReplacement.patch, maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=140058#action_140058 ] 

Henrik Brautaset Aronsen commented on MNG-2446:
-----------------------------------------------

I've added a patch against maven-install-plugin in MNG-3057 that fixes this issue.  It's sort of a hack, though, I don't reckon the patch will be added to the main stream code.

> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Priority: Minor
>             Fix For: Reviewed Pending Version Assignment
>
>         Attachments: maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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-2446) parent Pom properties not resolved for module dependencies

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

Henrik Brautaset Aronsen updated MNG-2446:
------------------------------------------

    Attachment: maven-version-problem.zip

I have the same problem, and I have  attached a test case (see maven-version-problem.zip):
{code}
first-+-second---third
      |
      +-fourth
{code}

Fourth depends on third.  Doing a {{mvn clean install}}  from root works fine. Doing the same within the {{fourth}} module fails to resolve the {{second}} artifact:

{code}
INFO] Using default encoding to copy filtered resources.
Downloading: http://repo1.maven.org/maven2/me/second/${applicationVersion}/second-${applicationVersion}.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
{code}

The problem is in the install plugin.  It creates pom files in the repository with an unparsed <version>:
{code}
$ cat ~/.m2/repository/me/second/1.0/second-1.0.pom 
<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>me</groupId>
    <artifactId>second</artifactId>
    <name>Second</name>
    <packaging>pom</packaging>
    
    <modules>
      <module>third</module>
    </modules>

    <parent>
        <groupId>me</groupId>
        <artifactId>first</artifactId>
        <version>${applicationVersion}</version> 
        <relativePath>../pom.xml</relativePath>
    </parent>
</project>
{code}
If I replace ${applicationVersion} to 1.0 in this file, the {{fourth}} module builds fine on itself.


> parent Pom  properties not resolved for module dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-2446
>                 URL: http://jira.codehaus.org/browse/MNG-2446
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>         Environment: WindowsXP/Linux - JDK 1.4 last version
>            Reporter: Jeremie Poutrin
>            Priority: Minor
>             Fix For: Reviewed Pending Version Assignment
>
>         Attachments: maven-version-problem.zip
>
>
> root-project --> root-pom.xml   with <version>${my.version}</version>
> |------->proj1 <parent><version>${my.version}</version></parent>
> |------->proj2 <parent><version>${my.version}</version></parent>
> |               |
> |               |->proj1 dependency
> |------->proj3 <parent><version>${my.version}</version></parent>
> if I compile from the root-project directory, all compile fine.
> if I compile from the proj2 directory, maven2 resolve proj2-${my.version}
> resolve proj1-${my.version}
> but tries to resolve the parent version root-project-${my.version} but this is not resolved.

-- 
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