Saturday, November 20, 2010

Gradle Build for Spring Framework and SLF4J without Apache Commons Logging

Gradle build system supports Transitive Dependency Management.

It's very useful when you depend on a library, say Spring Framework, that uses Apache Commons Logging (artifact commons-logging:commons-logging), but you want to use another library like SLF4J and want to exclude Commons Logging.

Here is the Gradle build to exclude the commons-logging transitive dependency.

repositories {

configurations {
all*.exclude group: 'commons-logging' // this is where we exclude

dependencies {
compile group: 'org.springframework', name: 'spring-web', version: '3.0.5.RELEASE'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.6.1'
runtime group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.6.1'
runtime group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.6.1'

// Example usage: Copy dependencies
// e.g. to the Google App Engine WEB-INF/lib directory
task copyDependencies << {
copy {
from configurations.compile
from configurations.runtime
into 'war/WEB-INF/lib'


Anonymous said...

This is a very simple but useful post. It has helped me get my new Spring MVC project build using gradle together in minutes. Thank you

coach outlet store online said... Coach Outlet Store Online Michael Kors Outlet Coach Factory Outlet Toms Shoes Cheap Jerseys Michael Kors Coach Outlet Coach Factory Outlet Coach Outlet Coach Handbags Giuseppe Zanotti Coach Factory Outlet Coach Factory Outlet Online Coach Outet Store Online Coach Factory Outlet Michael Kors Outlet Online Celine Outlet Michael Kors Michael Kors Store Tomss Hoes Prada Outlet Fitflop Footwear Celine Bags Fitflops Flipflops Fitflops Giuseppe Zanotti Designer Fitflops Giuseppe Zanotti Sneakersmen Fitflops

jhoney said...

You can't really say what is beautiful about a place, but the image of the place will remain vividly with you.||||

Double Glazing Preston said...

When virtue and modesty enlighten her charms, the lustre of a beautiful woman is brighter than the stars of heaven, and the influence of her power it is in vain to resist.

polo outlet said... Burberry Outlet Air Max Shoes Coach Black Friday Coach Black Friday Coach Cyber Monday Coach Factory Coach Outlet Factory Coach Outlet USA Coach Purses Factory Coach Purses USA Coach Store Outlet Coach Purses On Sale Monster Beats Outlet Louis Vuitton Outlet Louis Vuitton Factory Marc Jacobs On Sale MCM Outlet MCM 店铺 cheap oakley sunglasses Michael Kors Outlet Michael Kors Outlet Michael Kors Factory Michael Kors Outlet Michael Kors Factory Online Coach Factory Outlet North Face Outlet Online Polo Outlet Store Ralph Lauren UK Sac Longchamp Pairs Coach Outlet Online Coach Factory Oultet Barbour Jackets Outlet Online Canada Goose Outlet Gucci Outlet Online Michael Kors Outlet Moncler Clearance Moncler Jackets Outlet Online North Clearace Outlet Polo Ralph Lauren Outlet Online Woolrich Clearance Michael Kors Factory Outlet Coach Outlet Online USA Beats by Dre Coach Purses Outlet Online Michael Kors USA

Roller Shutters said...

There is no definition of beauty, but when you can see someone's spirit coming through, something unexplainable, that's beautiful to me.

Fastest Motorcycle said...

Yep. Schools are under pressure to better educate kids. Problem is, teachers and administrators sometimes confuse quantity and quality. Two hours of busy work doesn't do anyone a damned bit of good.

GOD is BIG Power said...

what is more, staff have the correct to make and be part of unions in addition because the right to strike. As a result labor unionisation is incredibly high, forty p.c of Italy’s working class was unionized.
Valium Online

Post a Comment

Copyright 2009 Spring vs Java EE Web Dev. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan