rakpan
rakpan

Reputation: 2863

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!

Upvotes: 5

Views: 2439

Answers (1)

Andy Wilkinson
Andy Wilkinson

Reputation: 116091

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
}

Upvotes: 4

Related Questions