Serve webjar as root resource

I have a Spring Boot Server that includes a webjar with my client code. I would like to serve this webjar in the root of my service, not in the / webjar / name / version directory.

I was able to reassign this config:

@Configuration
public class ClientResourceConfiguration extends WebMvcConfigurerAdapter {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/webjars/my-client/1.0-SNAPSHOT/");
    }
}

      

Two more problems: - I am coding the version in the path that I would like to avoid - Resources in the webjar are still available in the path / webjar / name / version

Any suggestions?

+3


source to share


1 answer


Two solutions:



  • repackaging your content directly under /META-INF/resources

  • vote for this Spring issue: SPR-12323
0


source







All Articles