Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot Gradle - avoid lib-provided folder in war file

I have a Spring Boot based application and I'm trying to switch over from Maven to Gradle. The application is supposed to build a war file, which is deployed to a web server (WildFly in our case).

Now, I have some libraries provided by the web server and thus using a "providedCompile" scope (For hibernate search and infinispan). Now, when used with Spring Boot plugin, the plugin is creating the war file with all the "providedCompile" libraries moved to a folder named "lib-provided".

How do I avoid this? On the same context, it is also adding the Spring Boot loader classes on to the war file. If possible, I need to avoid this too.

Please help! Thanks!

like image 916
rakpan Avatar asked Sep 27 '22 10:09

rakpan


1 Answers

If you're only ever going to deploy your application as a WAR file to an app server, then you don't need it to be turned into an executable archive. You can disable this repackaging in your build.gradle file:

bootRepackage {
    enabled = false
}
like image 69
Andy Wilkinson Avatar answered Sep 30 '22 01:09

Andy Wilkinson