woops, forgot to cc the group ---------- Forwarded message ---------- From: Eric Redmond <[EMAIL PROTECTED]> Date: Feb 28, 2007 11:53 AM Subject: Re: [m2] POM Inheritance To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
There's not much more to say about it. Create a pom.xml of packaging "pom" Give it a bunch of dependencies Install/Deploy that pom to your repository Now any project that depends on that pom project will get all of the pom project's dependencies, transatively. Eric On 2/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Could you pl elaborate on this use case? Thanks, /U -------------- Original message ---------------------- From: "Eric Redmond" <[EMAIL PROTECTED]> > 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 <http://codehaus.org/%7Eeredmond>
-- Eric Redmond http://codehaus.org/~eredmond <http://codehaus.org/%7Eeredmond> -- Eric Redmond http://codehaus.org/~eredmond