actually serve webjars

This commit is contained in:
MiniDigger 2020-07-12 11:38:35 +02:00
parent 6a84b68980
commit 4aec8bc9c4
2 changed files with 19 additions and 0 deletions

12
pom.xml
View File

@ -53,6 +53,13 @@
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.10.5</version>
<exclusions>
<exclusion>
<!-- old version -->
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
@ -81,6 +88,11 @@
</dependency>
<!-- webjars -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.30</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>jquery</artifactId>

View File

@ -45,6 +45,13 @@ public class MvcConfig implements WebMvcConfigurer {
.setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS))
.resourceChain(true)
.addResolver(new VersionResourceResolver());
registry
.addResourceHandler("/lib/**")
.addResourceLocations("/webjars/")
.setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS))
.resourceChain(true)
.addResolver(new VersionResourceResolver());
}
@Bean