I have not used webjars yet, but it looks like a good project that I needed to study more closely. I like it and I will send his hobby project to use it.
Take a look at the documentation for the servlet 3 section, it's really straightforward.
If you are not familiar with maven, here is the necessary part:
As a final step, add the maven-dependency-plugin to your pom.xml and use the unpack-dependencies target to unzip all the jar resources in the folder. The web assembly folder can be deployed to your http server.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>resource-dependencies</id> <phase>process-resources</phase> <goals> <goal>unpack-dependencies</goal> </goals> <configuration> <includeGroupIds>org.webjars</includeArtifactIds> <outputDirectory>${project.build.directory}/web-build</outputDirectory> </configuration> </execution> </executions> </plugin>
Unfortunately, I have not done this yet, but this answer should contain all the instructions for creating your project. In addition, you should be able to host the jar on the servlet 3 application server.
I created an example project and posted it on my github account: https://github.com/baumgartner/maven-webjars-plain-webproject
source share