This is exactly what I was looking for.  I didn't realize that you could
include a <type>pom</type> as a dependency.  This makes things much cleaner.

Thanks again,

jp4


Eric Redmond wrote:
> 
> Abstract it? I don't understand. The JDBC pom is just a seperate project.
> Like this:
> 
> JDBC POM:
> <project>
>   ...
>   <artifactId>my-jdbc-project</artifactId>
>   <packaging>pom</packaging>
>   <dependencies>
>     ... add jdbc dependencies here, like mysql jdbc, or sqlserver jdbc ...
>   </dependencies>
> </project>
> 
> Then, in your project that needs to use the jdbc drivers:
>   <dependencies>
>     <dependency>
>       <groupId>...</groupId>
>       <artifactId>my-jdbc-project</artifactId>
>       <version>...</version>
>       <type>pom</type>
>     </dependency>
>     ....
> 
> 
> 
> On 2/28/07, jp4 <[EMAIL PROTECTED]> wrote:
>>
>>
>> So how to you use this abstract jdbc pom file?  Do you include it as a
>> dependency in your data access modules?    Do you use it as the parent of
>> your data access modules?
>>
>> jp4
>>
>>
>> Eric Redmond wrote:
>> >
>> > Yeah, I do this quite a lot - for example, to abstract jdbc
>> > implementations
>> > across and organization - all jars required go into a pom project
>> called
>> > "jdbc". If you need to make an orthogonal change, just change jdbc's
>> > dependency list.
>> >
>> > Eric
>> >
>> > On 2/28/07, Thierry Lach <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Is it possible to declare a pom as a dependency, so that its
>> dependencies
>> >> would be inherited?  If that doesn't work, them maybe it should be
>> added
>> >> as
>> >> an enhancement.
>> >>
>> >> On 2/27/07, jp4 <[EMAIL PROTECTED]> wrote:
>> >> >
>> >> >
>> >> > I wonder if it would make sense to create a project of type jar that
>> >> does
>> >> > nothing more than declare common dependencies like spring and
>> >> hibernate.
>> >> > This way, by including a common data access jar file, all other data
>> >> > access
>> >> > modules would transitively include the spring and hibernate jars.
>> >> >
>> >> > Any thoughts our ideas would be greatly appreciated.
>> >> >
>> >> > jp4
>> >> >
>> >> > jp4 wrote:
>> >> > >
>> >> > > I have been doing some reading and it looks like the
>> >> <pluginManagement>
>> >> > > section will allow me to achieve part of what I want to do with
>> >> reusing
>> >> > > plugin configurations.
>> >> > >
>> >> > > jp4
>> >> > >
>> >> > > jp4 wrote:
>> >> > >>
>> >> > >> I have posted about this question several times before but
>> haven't
>> >> > >> received many responses.  I am hoping that someone has done or
>> knows
>> >> > how
>> >> > >> to accomplish the following.
>> >> > >>
>> >> > >> Basically, I have several multi module projects.  Each project
>> >> defines
>> >> > a
>> >> > >> parent pom.xml file which contains a list of modules as well as
>> the
>> >> > >> project's version id (all children use the parent.version).  In
>> >> > addition,
>> >> > >> if necessary, it defines any common dependencies for it's
>> modules.
>> >> > >>
>> >> > >> I have several projects that follow this pattern, most of which
>> >> produce
>> >> > a
>> >> > >> deployable webapp and consist of webapp, model, data access, and
>> >> > service
>> >> > >> modules.  For the most part, the data access modules usually
>> share
>> >> > common
>> >> > >> configuration such as spring and hibernate dependencies and
>> perhaps
>> >> > some
>> >> > >> common plugins.  So, in the case of a data access module, I would
>> >> like
>> >> > >> it's parent to be the projects' parent pom.xml file, but I would
>> >> also
>> >> > >> like it to be able to inherit data access configurations from a
>> >> > different
>> >> > >> pom.xml file.
>> >> > >>
>> >> > >> I know that you can create an inheritance chain, but in this
>> case,
>> I
>> >> > >> really don't want the project's parent pom.xml file to inherit
>> from
>> >> a
>> >> > >> data access pom.xml for obvious reasons.
>> >> > >>
>> >> > >> The solution may be that I have to redefine the spring and
>> hibernate
>> >> > >> dependencies as well as plugins in each data access project.  I
>> can
>> >> do
>> >> > >> that, but I wanted to explore a more elegant solution before
>> >> resorting
>> >> > to
>> >> > >> that.
>> >> > >>
>> >> > >> Any help would be greatly appreciated.
>> >> > >>
>> >> > >> Thanks,
>> >> > >>
>> >> > >> jp4
>> >> > >>
>> >> > >
>> >> > >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >> > http://www.nabble.com/POM-Inheritance-tf3304518s177.html#a9196345
>> >> > Sent from the Maven - Users mailing list archive at Nabble.com.
>> >> >
>> >> >
>> >> >
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > Eric Redmond
>> > http://codehaus.org/~eredmond
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/POM-Inheritance-tf3304518s177.html#a9226529
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> Eric Redmond
> http://codehaus.org/~eredmond
> 
> 

-- 
View this message in context: 
http://www.nabble.com/POM-Inheritance-tf3304518s177.html#a9234650
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to