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

Hi,

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 log4j.properties file that conflicts with mine. Is there a way to define a dependency on this jar file but have gradle exclude file log4j.properties from it?

Thanks,

Pat

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.