My spring boot war is simply too large and I want to make some optimalisation. SPring boot has the option to run war with java -jar
, that is why lib-provided
(with all provided
dependecies) is still inside the war even though the dependecies are not needed there (I will never run it as standalone). Can I somehow disable this clever functionality, so that I can save some space?
UPDATE: I am using Maven and spring boot maven plugin.
If the class is not on the classpath, you can use the excludeName attribute of the annotation and specify the fully qualified name instead. Finally, you can also control the list of auto-configuration classes to exclude by using the spring. autoconfigure. exclude property.
Just override the version as explained here in the Spring Boot Reference Guide. Assuming you are using the spring-boot-starter-parent as the parent you can just add a <selenium. version> to your <properties> section to specify which version you want. This will make Spring Boot use the version you want.
'provided' dependencies are placed in 'WEB-INF/lib-provided'. This is to avoid any clash when the war is deployed in a servlet container. 'WEB-INF/lib-provided' jars will only be used when war is executed as an application and the embedded server is used.
By Default Spring Boot Maven plugin will repackage your application into a executable WAR/JAR.
The original (i.e. non executable) artifact is renamed to .original by default but it is also possible to keep the original artifact using a custom classifier. refer the Spring Documentation
For Example:
If your app is named as MyApplication and you are trying to package it into a WAR, The following steps will happen:
MyApplication-0.0.1-SNAPSHOT.war
MyApplication-0.0.1-SNAPSHOT.war.original
.MyApplication-0.0.1-SNAPSHOT.war
(Spring boot executable)MyApplication-0.0.1-SNAPSHOT.war.original
(Non-Executable application)You can either remove the Spring Boot Maven Plugin all together or use the Non-Executable version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With