Is there a way to exclude a file (e.g. from a dependency jar file?


I’m trying to configure log4j for my application, but one of the jar files my application depends on is spring-boot-0.5.0.M5.jar, which includes a file that conflicts with mine. Is there a way to define a dependency on this jar file but have gradle exclude file from it?



You’d have to make the build unpack the Jar, delete the file, and add the resulting directory to the class path (or repack it). Before going there, I’d try if making sure that your file comes first on the class path is enough to solve the problem.

Peter, thanks for your reply. I figured that was probably going to be the answer, but I thought I’d ask anyway.