Please see the http://maven.apache.org/maven2/maven-model/maven.htmlreference
- what you're after is the "<parent>" element.

On 10/11/05, Russell, Mark <[EMAIL PROTECTED]> wrote:
>
> Thanks, that did help me get further.
>
> Next question, since I can't seem to find any documentation...
>
> How do you setup the pom of a subproject that depends on another
> subproject. Example:
>
> fx_toolkit
> pom.xml <-- parent pom
> projectA
> pom.xml
> projectB <-- projectB depends on projectA
> pom.xml
>
> I've tried a dependency in the projectB dependency that looks like:
> <dependency>
> <groupId>FXToolkit</groupId>
> <artifactId>FXCCConfig</artifactId>
> <version>${project.version}</version>
> </dependency>
>
> But when I then try to build the project it goes looking in the remote
> repository for the jar/pom. Anyway around this without actually
> deploying the jar/pom to the repo?
>
> Side note, I can build (kinda) from the root location (where the parent
> pom is) without encountering this error. (build still fails but due to
> missing other missing dependencies which I'm still working out.)
>
> Any ideas?
>
>
> MAR
>
>
> -----Original Message-----
> From: Stephen Duncan [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 06, 2005 6:59 PM
> To: Maven Users List
> Subject: Re: Maven 2.0 Multi-Project HowTo?
>
> 1st, there's no such thing, I think, as ${pom.currentVersion}; the
> equivalent in M2 would be ${project.version}
>
> However, from what I've seen so far, you're going to have to define
> the parent version in the subprojects. The idea here is that
> subprojects should be able to be built independently.
>
> Also, an early hint since you probably haven't gotten there yet:
> define the common dependency version in <dependencyManagement> section
> in the parent, and then define the dependencies the subprojects use in
> their pom.xml files, but dont' specify the version. This will pull
> the verison from the <dependencyManagement> section.
>
> -Stephen
>
> On 10/6/05, Russell, Mark <[EMAIL PROTECTED]> wrote:
> > Does someone have a document/article on how to do this with Maven 2.0?
> > So far my flailing around hasn't got me anywhere.
> >
> > If nothing else does someone have an example? I found this
> > (http://www.informit.com/articles/article.asp?p=411571) article but it
> > was for 1.0 and it doesn't seem to transfer for 2.0.
> >
> > Basically I'm trying to do something similar to the article above in
> > that I want to be able to define all the dependency version numbers
> and
> > the project version numbers in a top level (or common) pom.xml so that
> > when version numbers change I only have to touch a single file rather
> > than a dozen. The article shows almost exactly what I'm trying to do
> > (except I'm not working on a webapp) and I can't seem to replicate the
> > behavior.
> >
> > Basically I end up with the following error which seems wrong to me:
> > Downloading:
> >
> http://repo1.maven.org/maven2/FXToolkit/FXToolkit/${pom.currentVersion}/
> > FXToolkit-${pom.currentVersion}.pom
> >
> > Why should it be trying to fetch a .pom when I've told the subprojects
> > which pom.xml to use?
> >
> > Any help/links would be appreciated.
> >
> > Mark Russell
> >
> >
> >
> >
> > EXAMPLE
> > ==============
> > I've tried something similar to the following:
> >
> > Dir structure:
> >
> > - Toolkit
> > |- pom.xml (master)
> > |- FwkUtils
> > |- pom.xml
> > |- DomainFwk
> > |- pom.xml
> >
> > The master pom.xml looks like (note dependencies ommited for the
> > moment):
> >
> > <project>
> > <modelVersion>4.0.0</modelVersion>
> > <groupId>FXToolkit</groupId>
> > <artifactId>FXToolkit</artifactId>
> > <packaging>pom</packaging>
> > <version>3.0</version>
> > <description>FX Suite Toolkit</description>
> > <inceptionYear>2002</inceptionYear>
> >
> > <prerequisites>
> > <maven>2.0-beta-3</maven>
> > </prerequisites>
> >
> > <modules>
> > <module>FwkUtils</module>
> > <module>DomainFwk</module>
> > </modules>
> > </project>
> >
> >
> > The FwkUtils pom.xml:
> >
> > <project>
> > <modelVersion>4.0.0</modelVersion>
> >
> > <parent>
> > <artifactId>FXToolkit</artifactId>
> > <groupId>FXToolkit</groupId>
> > <version>${pom.currentVersion}</version>
> > <relativePath>../pom.xml</relativePath>
> > </parent>
> >
> > <artifactId>FwkUtils</artifactId>
> > <packaging>jar</packaging>
> >
> > <build>
> > <sourceDirectory>src/java</sourceDirectory>
> > <outputDirectory>target/classes</outputDirectory>
> > </build>
> > </project>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Stephen Duncan Jr
> www.stephenduncanjr.com <http://www.stephenduncanjr.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to