Thanks for the reply.

Well... My most (if not all) of my subprojects will be on the same version. Since I currently have about a dozen sub projects (and there will be more), I hate to go into each sub project and change the version number in the POM. I would rather change it in one place and have it reflected across all sub projects. That's what I thought inheritance of POM's provided. If these sub poms can't inherit the attribute of the super pom's version number, what kind of inheritance is this? Is there another way of doing what I described that works?

-los


From: "Eric Redmond" <[EMAIL PROTECTED]>
Reply-To: "Maven Users List" <[email protected]>
To: "Maven Users List" <[email protected]>
Subject: Re: Maven cyclic dependecy issue
Date: Tue, 21 Nov 2006 11:19:02 -0500

I see what you are trying to do... but why? If you do not define a child
project's version, it automatically inherits from its parent. Just take
<version>${main.version}</version> out.

On 11/21/06, Los Morales <[EMAIL PROTECTED]> wrote:

Hi,

I'm a bit frustrated on how Maven cycles through its
dependency.  Currently
I have a project consisting of multiple sub projects—2 levels
deep.  Here's
a hierarchy:

-->main
   --> sub1
      --> sub1sub1
      --> sub1sub2
   --> sub2

The main project has a POM looking like this:

<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.project.main</groupId>
    <artifactId>main</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>Main Project</name>
    <url>http://maven.apache.org</url>
    <packaging>pom</packaging>
    <properties>
        <main.version>1.0-SNAPSHOT</main.version>
    </properties>
    <modules>
        <module>sub1</module>
        <module>sub2</module>
    </modules>
...
</project>


Now say my sub2 project looks like this:

<project>
    <parent>
        <artifactId>main</artifactId>
        <groupId>com.project.main</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.project.main.core</groupId>
    <artifactId>main-core-api</artifactId>
    <name>Main Core API</name>
    <version>${main.version}</version>
    <packaging>jar</packaging>
</project>

Sub project 1 and its repective subprojects are similar.  Now, from my
root
project (main), I run any mvn command, I get the following error:

###################################
[INFO] Error building POM (may not be this project's POM).

Project ID: com.project.main.sub1.sub2:main-sub1-sub2:jar:${main.version}

Reason: Cannot find parent: com.project.main.sub1:main-sub1 for project:
com.project.main.sub1.sub2:main-sub1-sub2:jar:${main.version}
####################################


So I go to my sub2 project and run any mvn command, I get the same error.
Looks like its not able to figure out the runtime value of {main.version}.
Hence I can not continue with any build process.  Any help would be
appreciated.  Thanks in advance.

-los

_________________________________________________________________
Fixing up the home? Live Search can help

http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=en-US&source=hmemailtaglinenov06&FORM=WLMTAG


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Eric Redmond
http://codehaus.org/~eredmond

_________________________________________________________________
Get FREE company branded e-mail accounts and business Web site from Microsoft Office Live http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to