I'm using apache maven for build project, so i want to add my dependency javascript frameworks automatically based their version , organizing javascript frameworks , and download only modifiying label version . Exist some plugin similar like java dependencies or alternative with maven ?
I'm using apache maven for build project, so i want to add my dependency javascript frameworks automatically based their version , organizing javascript frameworks , and download only modifiying label version . Exist some plugin similar like java dependencies or alternative with maven ?
Share Improve this question asked May 21, 2013 at 21:31 cflores29cflores29 3741 gold badge6 silver badges16 bronze badges2 Answers
Reset to default 12There is standard way of doing this using a feature of the servlet api version 3. Any jar can expose web resources (javascripts, css, images, etc.) that are located under META-INF/resources.
To solve your problem I would create a maven project of type "jar" for every javascript framework that you want to re-use in your webapp projects.
The only caveat is that the servlet-api v3 requires Tomcat 7, which in turn requires Java 6, but this is usually not a problem.
See this blog: http://alexismp.wordpress./2010/04/28/web-inflib-jarmeta-infresources/
Servlet api 3 reference: http://download.oracle./otndocs/jcp/servlet-3.0-fr-eval-oth-JSpec/
It is possible to include javascript frameworks as <dependency>
via WebJars:
http://www.webjars/documentation
You could then include e.g. AngularJs like that:
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angularjs</artifactId>
<version>1.4.8</version>
</dependency>
WebJars are also hosted on maven central repository: http://search.maven/#artifactdetails%7Corg.webjars.bower%7Cangularjs%7C1.5.0-rc.1%7Cjar