On Thu, Oct 15, 2009 at 10:25 PM, Stevo Slavić <[email protected]> wrote:
[del]
> With Maven 2 one can in dependencyManagement section specify dependency
> exclusion (for spring-security's transitive dependencies to spring 2.0.x),
> but can not specify their effective replacements at same place - if I'm not
> mistaken, instead I have to spread that dependency replacement info all over
> the multi-module project pom's. For a non-reporting plugin one can specify
> exclusions and add dependencies but not for a dependency.

I may be wrong with this, but I think a way to work around this issue
is to create a "dependency project" (I'm not sure if that's the
correct term).

The only purpose for this project is to define all the dependencies in
one place and then where you need this "group" of dependencies your
project depends upon the "dependency project".

The "dependency project" has a packaging of pom.

e.g.
We use WebLogic 10 for our applications, but WebLogic is not built
with Maven so there is no dependency information.  After spending
hours chasing down the full jar list and the installing them locally
we created a WebLogic 10 "dependency project". It would look something
like this:

<project>
  <groupId>weblogic</groupId>
  <artifactId>weblogic-dependencies</artifactId>
  <version>10.0.0</version>
  <packaging>pom</packaging>
  ...
  <dependencies>
    <dependency>
      <groupId>weblogic</groupId>
      <artifactId>weblogic</artifactId>
      <version>10.0.0</version>
      <!-- Note: these would normally be scope=provided as they are
part of the weblogic runtime -->
    </dependency>
    <dependency>
      <groupId>weblogic</groupId>
      <artifactId>javax.jms_1.1</artifactId>
      <version>10.0.0</version>
    </dependency>
    <dependency>
      <groupId>weblogic</groupId>
      <artifactId>javax.servlet_2.5</artifactId>
      <version>10.0.0</version>
    </dependency>
    ...
  </dependencies>
</project>

Then any projects that want to use these dependencies include this
project like any other normal dependency.
Via transitive dependencies you pull in everything but have only had
to write it once.

You can do the same for your Spring projects.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to