On 03/12/2010 11:12 AM, Laird Nelson wrote:
On Fri, Dec 3, 2010 at 9:36 AM, Yanko, Curtis<curt_ya...@uhc.com>  wrote:

We only declare dependencies as<dependencyManagement>  items in our
Parent POMs and then declare *versionless* dependencies in each app so
they are explicit and comprehensible without having to go look somewhere
else (except for versioning which is all in one place too)

I have often wished for the ability to simply and easily refer to a group of
dependencyManagement entries with one element.  Going hand-in-hand with this
would of course be the ability to group and name such groups within the
dependencyManagement section.

Make a small set of aggregation POMs that build the library JARs that most applications use. This centralizes the choice of version and makes it easy to specify the dependencies in application modules since you may only have to specify 5 or 6 dependencies to pick up 50-60 3rd party and internal libraries. In those projects, you set the scope of the aggregated JARs to "provided" and then provide those libraries at run-time. This makes your war files much smaller and your builds much quicker.

Ron
  So, making this up:

  <dependencyManagement>
   <dependencyGroup>
     <id>persistence-dependencies</id>
     <dependency>
       <groupId>org.apache.openjpa</groupId>
       <artifactId>openjpa</artifactId>
       <version>${openJpaVersion}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.eclipse.persistence</groupId>
       <artifactId>javax.persistence</artifactId>
       <version>${eclipseLinkVersion}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.eclipse.persistence</groupId>
       <artifactId>org.eclipse.persistence.jpa</artifactId>
       <version>${eclipseLinkVersion}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.eclipse.persistence</groupId>
       <artifactId>org.eclipse.persistence.core</artifactId>
       <version>${eclipseLinkVersion}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-core</artifactId>
       <version>${hibernateVersion}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-entitymanager</artifactId>
       <version>${hibernateVersion}</version>
       <scope>test</scope>
     </dependency>
   </dependencyGroup>
</dependencyManagement>

Then, in a sub-pom:

<dependencies>
   <dependencyGroup>
     <id>persistence-dependencies</id>
   </dependencyGroup>
</dependencies>

Otherwise, lots of copying and pasting happens!

Best,
Laird



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

Reply via email to