For some reason bootstrap webjars are not being copied into target, and for that reason they cannot be found.
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
</parent>
...
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>4.1.3</version>
</dependency>
Resource handlers:
@Configuration
@EnableWebMvc
public class WebConfiguration implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("/WEB-INF/resources/*");
registry.addResourceHandler("/resources/").addResourceLocations("/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}
Somewhere in my static resources
...
<script src="webjars/bootstrap/4.1.3/js/bootstrap.min.js"></script>
...
Nothing is generated into /target
Any idea what am I missing?
I spend few hours on this and also reached second page on google searches.