Static content root with Spring Boot

Answered

Hello,

I am developing a web application using Spring Boot 2. I imported the Project into IntelliJ from Gradle. Spring Boot expects static resources (like Javascript, CSS) in static/* on the classpath. In the project this is src/main/resources/static/*. I am unable to convince IntelliJ that this is indeed the content root for static resources, IntelliJ insists that I prefix references to resources with /static/ in my html files, which then obviously will not work.

I have tried following the directions in the manual (see attached screenshots), but IntelliJ does not accept src/main/resources/static/* as my content root, no matter what I do.

I am using IntelliJ Ultimate 2018.2.

Any advice is appreciated.

3
1 comment

Hi, could you please provide a project example?

0

Please sign in to leave a comment.