Friday 15 July 2011

java - Spring boot WAR size with different embedded servers -


I am experimenting with spring boot and I realized that when I use the embedded tomcat server the resulting size is smaller when I use JetE or even the rest of the server Keep even with dependencies down.

How is this possible? ... It is believed that the Undertro and Jetties should be ultralight compared to Tomcat.

The size is:

Tomato ~ 18 MB

Bottom ~ 21 MB

JT ~ 24 MB

None of these looks very big for me because this dummy is the other endpoint. These are my dependencies:

  & lt; Dependency & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-web & lt; / ArtifactId> & Lt; Exclusions & gt; & Lt; Exclusion & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-badge & lt; / ArtifactId> & Lt; / Exclusion & gt; & Lt; / Exclusions & gt; & Lt; / Dependencies & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-jersey & lt; / ArtifactId> & Lt; / Dependencies & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-promoter & lt; / ArtifactId> & Lt; / Dependencies & gt; & Lt ;! - & lt; Dependency & gt; - & gt; & Lt ;! - & lt; GroupId> Org.springframework.boot & lt; / GroupId> - & gt; & Lt ;! - & lt; ArtifactId & gt; Spring-boot-starter-tomcat & lt; / ArtifactId> - & gt; & Lt ;! - & lt; / Dependencies & gt; - & gt; & Lt ;! - & lt; Dependency & gt; - & gt; & Lt ;! - & lt; GroupId> Org.springframework.boot & lt; / GroupId> - & gt; & Lt ;! - & lt; ArtifactId & gt; Spring-boot-starter-bandwidth & lt; / ArtifactId> - & gt; & Lt ;! - & lt; / Dependencies & gt; - & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-jet & lt; / ArtifactId> & Lt; / Dependencies & gt; & Lt ;! - & lt; Dependency & gt; - & gt; & Lt ;! - & lt; GroupId> Org.springframework.boot & lt; / GroupId> - & gt; & Lt ;! - & lt; ArtifactId & gt; Spring-boot-starter-test & lt; / ArtifactId> - & gt; & Lt ;! - & lt; Scope & gt; Test & lt; / Scope & gt; - & gt; & Lt ;! - & lt; / Dependencies & gt; - & gt; & Lt; / Dependencies & gt; Spring boot includes three sample applications,  spring-boot-sample-JT ,  spring-boot-sample-Tomket , and  spring-boot-sample-Auda , at least, and very similar, with functionality. With the Spring Boot 1.2.2.RELEASE, the archives are: 

  • spring-boot-sample-jt - 12MB
  • Spring-boot-sample-tomcat - 9.8MB
  • spring-boot-sample-flow - 9.6 MB

As you can see Tomcat and Undertave are very similar and JT Artifact is ~ 20% bigger.

The size of the gap is a significant cause JSP support does not support JSP and Spring boot is not included in JSP support Tomkat default ~ Jetty-based collection of 1.7 MB Akselis by Java compiler Used for JSP compilation. If you are not using you want to use the jetty and JSPs, you can exclude org.eclipse.jetty: jetty-jsp dependency. This reduces the size of jetty-based artifact to 8.8 MB.


No comments:

Post a Comment