[slf4j-user] Migrating from commons-logging

Joern Huxhorn jhuxhorn at googlemail.com
Sat Aug 13 21:34:21 CEST 2011


Hi Douglas

I'm not sure but I suspect that
<type>jar</type>
might be the root of your problem. Just delete that line and try it again.

Beside that, I can only guarantee that exclusion is working as expected in Maven 3.0.3 in combination with dependencyManagement in a parent pom.

So the following is working for me:
<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aop</artifactId>
			<version>${springVersion}</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>
</dependencyManagement>

Hope that helps.

Cheers,
Joern.

On 12.08.2011, at 16:20, Douglas Ferguson wrote:

> Hi,
> 
> I'm migrating a spring project from a hybrid of log4j and commons logging. I'd like to make sure that developer don't inadvertently use commons-logging or log4j directly
> 
> I ran the migrator. It worked great
> 
> I added exclusions to my pom, but eclipse still finds the commons-logging jar and when a run maven dependency:tree it still shows up:
> 
> 
> [INFO] +- org.springframework.ws:spring-ws-core:jar:2.0.0.RELEASE:compile
> [INFO] |  +- wsdl4j:wsdl4j:jar:1.6.1:compile
> [INFO] |  \- commons-logging:commons-logging:jar:1.1.1:compile
> 
> 		<dependency>
> 			<groupId>org.springframework.ws</groupId>
> 			<artifactId>spring-ws-core</artifactId>
> 			<version>${spring-ws-version}</version>
> 			<type>jar</type>
> 			<scope>compile</scope>
> 			<exclusions>
> 				<exclusion>
> 					<groupId>commons-logging</groupId>
> 					<artifactId>commons-logging</artifactId>
> 				</exclusion>
> 			</exclusions>			
> 		</dependency>
> 
> 
> 
> I also added this so that any dependencies that are using commons-logging will be ok
> 
> 		<dependency>
> 		  <groupId>org.slf4j</groupId>
> 		  <artifactId>jcl-over-slf4j</artifactId>
> 		  <version>1.6.1</version>
> 		</dependency>
> 
> Here's my other logging dependencies
> 
> 
> 
> 
> 		<!-- slf4j -->
> 		<dependency>
> 			<groupId>org.slf4j</groupId>
> 			<artifactId>slf4j-api</artifactId>
> 			<version>1.6.1</version>
> 			<type>jar</type>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.slf4j</groupId>
> 			<artifactId>slf4j-log4j12</artifactId>
> 			<version>1.6.1</version>
> 			<type>jar</type>
> 			<scope>compile</scope>
> 		</dependency>
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://qos.ch/mailman/listinfo/slf4j-user



More information about the slf4j-user mailing list