From dc1315f48e7cd02ce35ab3aecb27ff1f44bf6ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Sun, 16 Oct 2022 17:09:51 +0200 Subject: [PATCH] Use WebJars versioned URLs In order to improve efficiency (see spring-projects/spring-framework#27619) and allow native image compatibility, this commit uses WebJars versioned URLs which are supported out of the box on Spring Boot via /META-INF/resources default resource location configuration, removing the need to use webjars-locator-core dependency and WebJarsResourceResolver. I have been able to measure a consistent 5% startup time improvement on the JVM with that simple change on my local machine. --- build.gradle | 1 - pom.xml | 4 ---- src/main/resources/templates/fragments/layout.html | 4 ++-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 46ed6e03..5f62c061 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,6 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'javax.cache:cache-api' runtimeOnly 'org.springframework.boot:spring-boot-starter-actuator' - runtimeOnly 'org.webjars:webjars-locator-core' runtimeOnly "org.webjars.npm:bootstrap:${webjarsBootstrapVersion}" runtimeOnly "org.webjars.npm:font-awesome:${webjarsFontawesomeVersion}" runtimeOnly 'org.ehcache:ehcache' diff --git a/pom.xml b/pom.xml index c67bce23..d29355c5 100644 --- a/pom.xml +++ b/pom.xml @@ -89,10 +89,6 @@ - - org.webjars - webjars-locator-core - org.webjars.npm bootstrap diff --git a/src/main/resources/templates/fragments/layout.html b/src/main/resources/templates/fragments/layout.html index d5f378f4..8ab6deeb 100755 --- a/src/main/resources/templates/fragments/layout.html +++ b/src/main/resources/templates/fragments/layout.html @@ -17,7 +17,7 @@ - + @@ -87,7 +87,7 @@ - +