I am trying to add jQuery to my boot application using Webjars. I got inspiration from this tutorial: http://spring.io/blog/2014/01/03/utilizing-webjars-in-spring-boot
In my pom.xml, I added:
<dependency> <groupId>org.webjars</groupId> <artifactId>jquery</artifactId> <version>2.1.1</version> </dependency>
In my html file (using ThymeLeaf for my template engine - not sure if it matters) I have the following:
<script src="webjars/jquery/2.1.1/jquery.min.js"></script>
The file does not load. I tried both src = "webjars ...." and src = "/ webjars ...".
I see a jar in the Maven dependencies listed in my project. When I research this jar, I see META-INF / resources / webjars / jquery / 2.1.1 / jquery.min.js. Based on how I understand that Boot is looking for resources, I think it should find this.
Does anyone see this behavior? Any tips on how to deal with this problem?
source share