问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/42164938/step-by-step-guide-on-how-to-create-a-webjar-for-front-end-application