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 ?
There 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.com/2010/04/28/web-inflib-jarmeta-infresources/
Servlet api 3 reference: http://download.oracle.com/otndocs/jcp/servlet-3.0-fr-eval-oth-JSpec/
It is possible to include javascript frameworks as <dependency>
via WebJars:
http://www.webjars.org/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.org/#artifactdetails%7Corg.webjars.bower%7Cangularjs%7C1.5.0-rc.1%7Cjar
© 2022 - 2024 — McMap. All rights reserved.