Reputation: 3155
In my spring boot app I have the following configuration to generate a war.
apply plugin: 'war'
war {
baseName = 'sales_service_shared'
version = '0.0.1'
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
...
}
Everything is working fine and the war is generated.
But the web.xml is missing. how can a war work without web.xml ?
Upvotes: 2
Views: 3443
Reputation: 16374
In case you are deploying your application in a container supporting the latest JEE specs i.e. Servlet 3.0+ environments, the web.xml (aka deployment descriptor) is not mandatory.
Actually all the underlying servlet initializing goes programmatically through a org.springframework.web.WebApplicationInitializer
implementation for a Spring applicationand similar mechanism.
Upvotes: 5