From 3527861ea139beee5417d4ed20630682bac97258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Wed, 5 Apr 2023 15:36:04 +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. Similar to https://github.com/spring-projects/spring-petclinic/pull/1099 --- build.gradle.kts | 2 +- src/main/resources/templates/fragments/layout.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b8c364f..edf9deb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,7 @@ plugins { kotlin("plugin.spring") version kotlinVersion } +// WebJars versions are also referenced in src/main/resources/templates/fragments/layout.html for resource URLs val boostrapVersion = "5.1.3" val fontAwesomeVersion = "4.7.0" @@ -51,7 +52,6 @@ dependencies { implementation("javax.cache:cache-api") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation("org.jetbrains.kotlin:kotlin-reflect") - implementation("org.webjars:webjars-locator-core") implementation("org.webjars.npm:bootstrap:$boostrapVersion") implementation("org.webjars.npm:font-awesome:$fontAwesomeVersion") diff --git a/src/main/resources/templates/fragments/layout.html b/src/main/resources/templates/fragments/layout.html index fe26153..916ce1e 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 @@ - +