In my Spring Boot project, when I do a maven build, my css stylesheet is not located. I have already taken advice from the official Spring Boot documentation and other stackoverflow posts, and have put my css file in resources/static/css directory.
|_src
|_main
|_java
|_resources
|_templates
|_static
|_css
|_master.css
Declaring the css stylesheet in the thymeleaf layout (html file under templates directory):
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ipp="" xmlns:th="http://www.thymeleaf.org">
<head>
<link rel="stylesheet" href="../static/css/master.css" th:href="@{/css/master.css}" media="screen"/>
</head>
My pom.xml includes spring-boot-starter-web and spring-boot-starter-thymeleaf, so it is expected that the Spring-Boot ResourceLocations should map static content to src/main/resources/static.
I have also attempted:
th:href="@{css/master.css}"
AND
th:href="@{static/css/master.css}"
AND
th:href="@{../static/css/master.css}"
AND complete removal of th:href=...
Any ideas on what is preventing the stylesheet from being located?