Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using WebJars with Maven - on Intellij and/or Eclipse

I really tried hard but I cannot figure out how to let Maven handle WebJars so that I can:

  • use the JavaScript libraries while programming
  • include the required files when packaging and deploying

Adding the dependencies to the pom.xml lets Maven download the files - so far so good. But Maven does not copy the content to the build directory so that the resulting path and file structure contains the dependencies.

My project can be found here: https://github.com/anthraxn8b/m3

I am new to nearly everything I use.

like image 738
eventhorizon Avatar asked Nov 20 '25 22:11

eventhorizon


1 Answers

The JARs are copied to the WEB-INF/lib folder, when you package the WAR file. That's sufficient, you then can just access the resources (for example AngularJS with the path /webjars/angularjs/2.0.0-alpha.22/angular2.js).

like image 115
dunni Avatar answered Nov 22 '25 11:11

dunni