Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails-like Asset Pipeline solution for JSP Maven apps?

I've used Rails quite a lot in the past and have come to love the Asset Pipeline in Rails 3 and 4.

Now, my corporate team has switched away from Rails to JSP with Maven :(

Are there any solutions out there for JSP Maven projects that offer similar features of the Rails Asset Pipeline? Such as

  1. Asset minification
  2. Asset concatenation
  3. Fingerprinting

First and foremost, I need this to work for JavaScript. If it works for CSS too, wonderful. If it works for images as well, bonus points. And extra bonus points if it works with RequireJS.

Lastly, I envision this allowing one to link to scripts in the document <head> via something like

<pipeline:scripts ref="app/app.js">

which would be on par with the Rails way,

<% javascript_include_tag 'app/app.js' %>

and this would result in

<script type="text/javascript" href="/my-app/resources/js/app/app-943a20b66ab086745dae8d4a08dfb530.js"></script>

So far I have found this and am trying that now: https://github.com/dwelch2344/asset-pipeline. Are there any other solutions? I'm also open to Grunt-type solutions.

like image 523
Chad Johnson Avatar asked Nov 02 '22 07:11

Chad Johnson


1 Answers

Check out wro4j, which is what I've been using. It's not nearly as elegant or strong in features as the Rails Asset Pipeline, but it offers enough to get you through.

like image 125
leojh Avatar answered Nov 15 '22 05:11

leojh