I'm trying to eliminate commons-logging from being transitively passed
on to projects that depend on my library and my library uses spring.
Spring uses commons-logging but doesn't mark it as optional or
scope:provided, however when I try to exclude commons logging from a
spring dependency, I no longer get it even though it is declared in my
pom.

Here's a simple pom which exposes the problem (maven 2.0.4):

<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
 <modelVersion>4.0.0</modelVersion>
 <groupId>some.groupid</groupId>
 <artifactId>blah</artifactId>
 <packaging>jar</packaging>
 <version>1.0-SNAPSHOT</version>
 <name>blah</name>
 <url>http://maven.apache.org</url>

 <dependencies>
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>3.8.1</version>
     <scope>test</scope>
   </dependency>

   <dependency>
     <groupId>commons-logging</groupId>
     <artifactId>commons-logging</artifactId>
     <version>1.1</version>
     <scope>provided</scope>
     <exclusions>
       <exclusion>
         <groupId>avalon-framework</groupId>
         <artifactId>avalon-framework</artifactId>
       </exclusion>
       <exclusion>
         <groupId>javax.servlet</groupId>
         <artifactId>servlet-api</artifactId>
       </exclusion>
       <exclusion>
         <groupId>log4j</groupId>
         <artifactId>log4j</artifactId>
       </exclusion>
       <exclusion>
         <groupId>logkit</groupId>
         <artifactId>logkit</artifactId>
       </exclusion>
     </exclusions>
   </dependency>

   <dependency>
     <groupId>org.springframework</groupId>
     <artifactId>spring-dao</artifactId>
     <version>2.0</version>
     <exclusions>
       <exclusion>
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>
       </exclusion>
     </exclusions>
   </dependency>
 </dependencies>
</project>

Now if you remove the commons-logging exclusion from the spring-dao
dependency, commons-logging get correctly pulled down.  Also note that
this problem does NOT surface if I use spring-context even though the
poms appear to be practically identical.

Whats going on?

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

Reply via email to