-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Spring Boot with GraalVM
-
Signed JARs are not supported, see spring-framework#29019
-
Mockito is not supported yet, see #32195
-
Buildpacks do not yet have official support for building images for ARM. Instructions for creating your own ARM-compatible builder are available.
-
WebJars are not recommended with native images since the
webjars-locator-core
dependency involves unsupported resource scanning at runtime, and since WebJars dependencies lead to the inclusion of unneeded resources fromMETA-INF/resources/
. Alternative approaches like directly shipping the required frontend resources in the web application, potentially by leveraging Node.js Gradle or Maven integration if needed, should be preferred.
tomcat-embed-programmatic
is an experimental Tomcat dependency designed to lower the memory footprint. Using it produces smaller native images.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tomcat.experimental</groupId>
<artifactId>tomcat-embed-programmatic</artifactId>
<version>${tomcat.version}</version>
</dependency>
implementation('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'org.apache.tomcat.embed', module: 'tomcat-embed-core'
exclude group: 'org.apache.tomcat.embed', module: 'tomcat-embed-websocket'
}
String tomcatVersion = dependencyManagement.importedProperties['tomcat.version']
implementation "org.apache.tomcat.experimental:tomcat-embed-programmatic:$tomcatVersion"