Please ignore my last mail regarding the import scope. Not sure what went on in my head writing that...:-) However, do have a look at the blog post I linked to. I think this is what you're talking about.
What I think is wrong in your poms, is that in the "grouped" poms you should declare the dependencies as compile. Then you declare a dependency in your project of the grouped pom with the provided scope. It should work fine. One thing to understand is that the dependencies end up on the wrong level in the dependency hierarchy. Normally not a problem, but it could affect version resolution. /Anders On Sun, Dec 27, 2009 at 23:23, Anders Hammar <[email protected]> wrote: > Could you please state where in the Def Guide you read about pom > dependencies? Is it possible that you're talking about the import scope and > referencing a pom as also described in this blog post: > > http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-grouping-dependencies/ > > /Anders > > On Sun, Dec 27, 2009 at 19:01, Ron Wheeler <[email protected] > > wrote: > >> We are developing a portal project (in production for 2 years now) >> that has dozens of webapps that share a lot of the same jar files. >> We have started out on the road to chaos with each project having its own >> POM file that is completely independent of its friends. >> Having not quite reach the State of Chaos, we are starting to look more >> closely at how Maven can help us. >> >> By reading the Definitive Guide, I found that there is the potential of a >> "parent POM" and POM dependencies. >> I also read the section about grouping libraries together into logical >> groups described by a POM file that can be shared. >> This looks great. >> I looked though the jars that we need and share; looked at the >> dependencies for these jars and started to develop a strategy to just get 1 >> copy of 1 version of the basic set of jars into the Tomcat shared or common >> directories. >> >> This means in my case that I have a "Jetspeed" POM, a JSF POM, a "Spring, >> Hibernate, MySQL, Tomcat" POM and a utilities (mostly commons-xxx) POM. >> In each of these POM files, I have excluded shared sub-dependencies and >> marked all of the jars as "provided". >> >> In each project POM, I refer to the shared POMs as dependencies. >> >> The problem is that the jars listed in the shared POMs are not visible >> during the build unless I mark them as "compile" scope in their family POMs >> even though they will be provided. >> I gather that this will cause them to be included in the war being >> constructed and I will still get dozens of copies of the same jars in the >> various webapp war files instead of just one copy of the shared jars and >> only webapp-specific jars in each webapp's war file. >> >> >> Am I doing something wrong or is this just the way it is supposed to work? >> >> Is there a "right" way to get what I want. 1 copy of shared jars in >> Tomcat's shared folder and small war files only containing the jars not in >> shared. >> >> Thanks >> >> Ron >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> >
