Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Step by step guide on how to create a webjar for Front-End Application? [closed]

Hello I've been looking for a step by step guide on how to create a webjar of an existing project. My Front-End project is currently using Angular 2 + webpack, I understand the files need to go in a specific directory META-INF/resources/webjars and that there should be a starter Maven pom file somewhere in the project. The thing is I'm not sure where or how to start implementing this inside my project and so I'm asking here if anyone could help me out or knows where I can find a step by step guide for this.

I plan to use the webjar as a dependency for another project built using Spring Boot. Any help is greatly appreciated.

like image 445
Tuco Avatar asked Feb 10 '17 17:02

Tuco


1 Answers

WebJars is really just a packaging of JS / CSS libs that can easily be used as dependencies in Java builds. By putting the contents of these libraries in the META-INF/resources they are automatically available as static resources in most Java web servers. So to create your own JAR that has static resources in the META-INF/resources you can create a JAR however you like. This is usually done with a build tool like Maven or Gradle. If you want to publish that JAR somewhere that anyone can consume as a dependency then most people use Maven Central.

like image 90
James Ward Avatar answered Oct 17 '22 08:10

James Ward