在Spring MVC应用程序中找不到静态资源

我正在使用MVC Web应用程序。在Spring Security中使用Spring Boot 2.0.1。 当我尝试到达静态资源时出现错误404。

enter image description here

我尝试了不同的方法,阅读了许多主题,但是找不到任何解决方案。

配置类:

@SpringBootApplication
@EnableWebMvc
public class FriendlyFireChessApplication extends SpringBootServletInitializer implements WebMvcConfigurer {

    @Autowired
    private SpringApplicationContext springApplicationContext;

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(FriendlyFireChessApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(FriendlyFireChessApplication.class, args);
    }

    /*
    some beans here
    */

    @Override
    public void addResourceHandlers(final ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
    }
}

项目结构:

enter image description here

index.html:

<DOCTYPE html>
    <html lang="en">

    <head>
        <title>Friendly fire chess</title>

        <link rel="stylesheet" type="text/css" href='/static/css/style.css'/>
    </head>

    <body>
        <header>
            <div class="main_header">
                <div>
                    <a id="icon"><img src='/static/img/logo_1.png' width="40" height="70" border="0" /></a>
                </div>

                <div id="main_title">
                    <span>Friendly Fire Chess</span>
                </div>

                <div class="authentication_bar">
                    <div>
                        <span><a id="log_in_button" href='http://www.ffchess.org/login'>Login</a></span>
                    </div>

                    <div>
                        <span><a id="sign_in_button" href="http://www.ffchess.org/signin">Sign In</a></span>
                    </div>
                </div>

            </div>

        </header>

    </html>

安全设定:

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable().authorizeRequests()
            .antMatchers(HttpMethod.POST, SecurityConstants.SIGN_UP_URL)
            .permitAll()
            .antMatchers(HttpMethod.GET, SecurityConstants.VERIFICATION_EMAIL_URL)
            .permitAll()
            .antMatchers(HttpMethod.POST, SecurityConstants.PASSWORD_RESET_REQUEST_URL)
            .permitAll()
            .antMatchers(HttpMethod.POST, SecurityConstants.PASSWORD_RESET_URL)
            .permitAll()
            .antMatchers(SecurityConstants.H2_CONSOLE)
            .permitAll()
            .antMatchers(SecurityConstants.HOME_PAGE)
            .permitAll()
            .antMatchers("/resources/**", "/static/css/**", "/static/img/**")
            .permitAll()
            .anyRequest().authenticated().and()
            .addFilter(getAuthenticationFilter())
            .addFilter(new AuthorizationFilter(authenticationManager()))
            .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);

}

这一切怎么了?