You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Litton, Tom - CEPM" <To...@cepm-us.com> on 2005/08/25 18:12:09 UTC

common dependency in maven 1

I was hoping to get some advice from all of you brilliant and kind maven users.
 
I have several projects (about 10) that all depend on a core library.  All the projects and the core extend from the same project.xml.
 
I would really like to add the dependency on the core library in the parent project.xml, however, this causes a problem when compiling the core library.  Has anyone come up with a good idea of what to do in this case?  What is the best practice in this case?  
 
I've tried adding this to the parent project.xml:
 
<j:if test="${pom.getProperty('artifactId') != 'core'}">
            <dependency>
                <groupId>mygroup</groupId>
                <artifactId>core</artifactId>
                <version>1.1-SNAPSHOT</version>
            </dependency>
</j:if>
 
But, it isn't working and is kind of a hack anyways.  
 
Thanks all,


----------------------------------------------------------------------
The information contained in this transmission is intended only for
the personal and confidential use of the designated recipients named
herein.  If the reader of this transmission is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
transmission in error, and that any review, dissemination,
distribution, or copying of this transmission is strictly prohibited.
If you have received this communication in error, please notify the
sender and return and delete the original transmission immediately.
Thank you.


Re: common dependency in maven 1

Posted by dan tran <da...@gmail.com>.
how about restructure your source tree as

   root
       core
       subproject
           common-settings   <-- make 
           sub 1
           sub 2
           ....

have all subx to inherit from common-setting project which has core as
dependency

In your root set

maven.multiproject.type=multiproject

in your  subproject's properties , set

  maven.multiproject.type=multiproject
  maven.multiproject.include=subproject/sub1.proejct.xml,
subproject/sub2/project.xml ... etc

In your common-settings, make sure it has core and core dependencies
on its dependencies list. ( In M2, all you need is core)

In all subx set

  maven.multiproject.type=jar 


Then from root, do

  maven multiproject:install


On 8/25/05, Litton, Tom - CEPM <To...@cepm-us.com> wrote:
> I was hoping to get some advice from all of you brilliant and kind maven users.
> 
> I have several projects (about 10) that all depend on a core library.  All the projects and the core extend from the same project.xml.
> 
> I would really like to add the dependency on the core library in the parent project.xml, however, this causes a problem when compiling the core library.  Has anyone come up with a good idea of what to do in this case?  What is the best practice in this case?
> 
> I've tried adding this to the parent project.xml:
> 
> <j:if test="${pom.getProperty('artifactId') != 'core'}">
>            <dependency>
>                <groupId>mygroup</groupId>
>                <artifactId>core</artifactId>
>                <version>1.1-SNAPSHOT</version>
>            </dependency>
> </j:if>
> 
> But, it isn't working and is kind of a hack anyways.
> 
> Thanks all,
> 
> 
> ----------------------------------------------------------------------
> The information contained in this transmission is intended only for
> the personal and confidential use of the designated recipients named
> herein.  If the reader of this transmission is not the intended
> recipient or an agent responsible for delivering it to the intended
> recipient, you are hereby notified that you have received this
> transmission in error, and that any review, dissemination,
> distribution, or copying of this transmission is strictly prohibited.
> If you have received this communication in error, please notify the
> sender and return and delete the original transmission immediately.
> Thank you.
> 
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: common dependency in maven 1

Posted by Brett Porter <br...@gmail.com>.
This is easier in m2... in m1, I'd suggest having another parent that
simply extends the original parent and adds the core dep. All the
projects except core should extend that.

On 8/26/05, Litton, Tom - CEPM <To...@cepm-us.com> wrote:
> I was hoping to get some advice from all of you brilliant and kind maven users.
> 
> I have several projects (about 10) that all depend on a core library.  All the projects and the core extend from the same project.xml.
> 
> I would really like to add the dependency on the core library in the parent project.xml, however, this causes a problem when compiling the core library.  Has anyone come up with a good idea of what to do in this case?  What is the best practice in this case?
> 
> I've tried adding this to the parent project.xml:
> 
> <j:if test="${pom.getProperty('artifactId') != 'core'}">
>             <dependency>
>                 <groupId>mygroup</groupId>
>                 <artifactId>core</artifactId>
>                 <version>1.1-SNAPSHOT</version>
>             </dependency>
> </j:if>
> 
> But, it isn't working and is kind of a hack anyways.
> 
> Thanks all,
> 
> 
> ----------------------------------------------------------------------
> The information contained in this transmission is intended only for
> the personal and confidential use of the designated recipients named
> herein.  If the reader of this transmission is not the intended
> recipient or an agent responsible for delivering it to the intended
> recipient, you are hereby notified that you have received this
> transmission in error, and that any review, dissemination,
> distribution, or copying of this transmission is strictly prohibited.
> If you have received this communication in error, please notify the
> sender and return and delete the original transmission immediately.
> Thank you.
> 
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org