From 177d8aaca63adb65cdb512e92e734e8948085461 Mon Sep 17 00:00:00 2001 From: leebj Date: Mon, 3 Jun 2024 14:42:31 +0900 Subject: [PATCH] no message --- pom.xml | 17 ++++++++++++++++- .../java/cokr/xit/applib/WebjarsConfig.java | 17 +++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/main/java/cokr/xit/applib/WebjarsConfig.java diff --git a/pom.xml b/pom.xml index 49a4fc7..f780804 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,13 @@ ${project.artifactId}-${project.version} - ${basedir}/src/main/resources + + ${basedir}/src/main/resources + + + ${basedir}/src/main/webapp/resources + META-INF/resources/webjars/resources + @@ -60,6 +66,14 @@ + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + true + + org.apache.maven.plugins maven-compiler-plugin @@ -91,6 +105,7 @@ **/*.class + META-INF/resources/webjars/resources/** diff --git a/src/main/java/cokr/xit/applib/WebjarsConfig.java b/src/main/java/cokr/xit/applib/WebjarsConfig.java new file mode 100644 index 0000000..9515dd3 --- /dev/null +++ b/src/main/java/cokr/xit/applib/WebjarsConfig.java @@ -0,0 +1,17 @@ +package cokr.xit.applib; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebjarsConfig implements WebMvcConfigurer { + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + + registry.addResourceHandler("/resources/**") + .addResourceLocations("/webjars/resources/"); + + } +}