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 {
mavenCentral()
}

configurations {
compile
runtime
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'
}
}

8 comments:

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...

http://www.coachoutletstoreinc.com/ Coach Outlet Store Online

http://www.michaelkorsoutletmkinc.com/ Michael Kors Outlet

http://www.coachfactoryoutletwebsite.com/ Coach Factory Outlet

http://www.tomsusashoes.com/ Toms Shoes

http://www.cheapjerseysinc.com/ Cheap Jerseys

http://www.michaelkors-bedford.com/ Michael Kors

http://www.coachoutlet-sale.com/ Coach Outlet

http://www.coachfactoryoutletorg.com/ Coach Factory Outlet

http://www.coachoutlet-buy.com/ Coach Outlet

http://www.coachhandbagsonlineoutlet.com/ Coach Handbags

http://www.giuseppezanottionline.com/ Giuseppe Zanotti

http://www.coachfactoryoutlet-handbags.com/ Coach Factory Outlet

http://www.coach-factory-outlet-online.com/ Coach Factory Outlet Online

http://www.coachstoreonline.com/ Coach Outet Store Online

http://www.coachfactoryoutlets2014.com/ Coach Factory Outlet

http://www.michaelkorsoutletonlinemk.com/ Michael Kors Outlet Online

http://www.celineoutlet-online.com/ Celine Outlet

http://www.michaelkors.name/ Michael Kors

http://www.michael-kors-outlet-store.com/ Michael Kors Store

http://www.tomsshoescompany.com/ Tomss Hoes

http://www.pradaoutlet-store.com/ Prada Outlet

http://www.fitflopfootwear.com/ Fitflop Footwear

http://www.celinebags-outlet.com/ Celine Bags

http://www.fitflopsflipflops.com/ Fitflops Flipflops

http://www.fitflopusaonline.com/ Fitflops

http://www.giuseppezanottidesigner.com/ Giuseppe Zanotti Designer

http://www.fitflopflip-flop.com/ Fitflops

http://www.giuseppezanottisneakersmen.com/ Giuseppe Zanotti Sneakersmen

http://www.fitflopsandalssale.com/ 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.
http://empoweringhomebusiness.com|http://educationindexing.com|http://thehealthprovider.com|http://cotton-house-hotel.com|http://legalprecedence.com

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...

http://www.burbagssale2014.com/ Burberry Outlet
http://www.airmaxshoesfactory.com/ Air Max Shoes
http://www.coachblackfriday2014.com/ Coach Black Friday
http://www.coach-storeoutletonline.com/ Coach Black Friday
http://www.coachcoachoutlet.com/ Coach Cyber Monday
http://www.coachxfactory.com/ Coach Factory
http://www.coach-factoryoutletonline.net/ Coach Outlet Factory
http://www.coach-outletonlineusa.com/ Coach Outlet USA
http://www.coach-pursesfactory.com/ Coach Purses Factory
http://www.coachpurseusa.com/ Coach Purses USA
http://www.coach-storeoutlet.com/ Coach Store Outlet
http://www.coach-pursesonline.com/ Coach Purses On Sale
http://www.monsterbeatsbydres.com/ Monster Beats Outlet
http://www.louis-vuittonblackfriday.com/ Louis Vuitton Outlet
http://www.lv-guccishoesfactory.com/ Louis Vuitton Factory
http://www.marcjacobsonsale.com/ Marc Jacobs On Sale
http://www.mcmworldwides.com/ MCM Outlet
http://www.mcmoutlet-jp.com/ MCM 店铺
http://www.oakleysunglassesfactory.com/ cheap oakley sunglasses
http://www.michaelkorsmas.com/ Michael Kors Outlet
http://www.michaelkors.so/ Michael Kors Outlet
http://www.michaelkorsfactory-store.com/ Michael Kors Factory
http://www.michaelkorsoutletr.com/ Michael Kors Outlet
http://www.michael-korsfactoryonline.com/ Michael Kors Factory Online
http://www.newcoachfactoryoutlet.com/ Coach Factory Outlet
http://www.north-faceoutletonlines.net/ North Face Outlet Online
http://www.polo-outletstore.com/ Polo Outlet Store
http://www.ralph-laurenhome.com/ Ralph Lauren UK
http://www.saclongchamppairs.com/ Sac Longchamp Pairs
http://www.tcoachoutletonline.com/ Coach Outlet Online
http://www.the-coachfactoryoutlet.com/ Coach Factory Oultet
http://www.barbour-jacketsoutlet.com/ Barbour Jackets Outlet Online
http://www.canada-gooser.com/ Canada Goose Outlet
http://www.guccishoesuk-2014.com/ Gucci Outlet Online
http://www.michaelkorsstates.com/ Michael Kors Outlet
http://www.moncler-clearance.com/ Moncler Clearance
http://www.moncler-jacketsoutletonline.com/ Moncler Jackets Outlet Online
http://www.northsclearance.com/ North Clearace Outlet
http://www.polo-ralphlaurenonline.com/ Polo Ralph Lauren Outlet Online
http://www.woolrich-clearance.com/ Woolrich Clearance
http://www.cvshopfactory.com/ shop.coachfactory.com
http://www.mksfactoryoutlet.com/ Michael Kors Factory Outlet
http://www.zxcoachoutlet.com/ Coach Outlet Online USA
http://www.thebeatsbydre.net/ Beats by Dre
http://www.superbagsmarket.com/
http://www.newoutletonlinemall.com/ Coach Purses Outlet Online
http://www.clickmichaelkors.com/ 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