Thanks for your reploy

But this is what exactly i'm trying,i meant i had in depedency management 
like

if i have project structure

Project
        |Module-A
                |subModule-A
                        -pom.xml

            - pom.xml
        |Module-B
                |subModule-B
                        -pom.xml

- pom.xml

  when i have subModule-B dependent an subModule-Athen i changed my 
pom.xml in subModule-B like
 
                        <dependency>
                                <groupId>Project.Module-A</groupId>
                                <artifactId>subModule-A</artifactId>
                                <version>${moduleA.version}</version>
                                <type>jar</type>
                                <scope>provided</scope>
                        </dependency>

my subModule-A pom looks like 

        <modelVersion>4.0.0</modelVersion>
        <parent>
                <groupId>Project.Module-A</groupId>
                <artifactId>subModule-A</artifactId>
                <version>${moduleA.version}</version>
        </parent>
and my Module-A pom.xml like

        <modelVersion>4.0.0</modelVersion>
        <groupId>Project</groupId>
        <artifactId>Module-A</artifactId>
        <name>Module-A</name>
        <packaging>pom</packaging>
        <version>${moduleA.version}</version>   

then from my Module-A directory i defined 
<moduleA.version>4.3</moduleA.version> in my settings .xml

then when i ran mvn deploy from Module-A directory i saw that the property 
value from settings.xml has beeen taken and my Module-A and subModule-A 
version are deployed into my internal repository as well as 
localRepository with the version number 4.3

then i tried to run mvn deploy from my Module-B directory assuming that 
allmy properties will be replaced, but here when its building subModule-B 
its errored out displaying it could find depedency for 
subModule-A.${moduleA.version} why is it so???

why its not taking the property value from settings.xml??

or I'm doing something wrong here?? Please advice



Thanks,
Raghu 





"Wayne Fay" <[EMAIL PROTECTED]>
03/24/2006 10:09 AM
Please respond to "Maven Users List"

 
        To:     "Maven Users List" <[email protected]>
        cc: 
        Subject:        Re: Different version of build


Pople generally use the <dependencyManagement> configuration for
situations like these.

You need to specify the version number in one place (in the depMgmt in
root project) and then omit the version in other <dep> references.

Wayne


On 3/24/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi All
>
> How do i change the build or dependecy  version at run time
>
> I mean if i have more than one module on project like Module-A, 
Module-B,
> those module intern has some submodules, my Module-B dependes one of
> subModdule-A but different times i need to build Module-B againt 
different
> version of subModule-B. i know for sure we can achieve this thru 
changing
> dependency section of Module-B but instread of that i tried having
> something like <version>${subModule-A.version}</version> and then tried
> having properties <subModule-A.version>4.3</subModule-A.version> in my
> settings.xml Profile, and also tried by passing it has system property 
as
> -DsubModule-A.version=4.3, but both ways its throwing error. saying it
> couldn't resolve dependency for ${subModule-A.version}
>
> Is there way to make pom.xml to subsitute that ${subModule-A.version}
> value to take either from settings.xml or from system property
>
> Its been driving crazy, Please if some one has done this can u share 
your
> solution for this??
>
>
>
> Thanks,
> Raghu
>
>


Reply via email to