views:

121

answers:

2

Sprocket is a Ruby library for managing JavaScript dependencies. It makes it possible to declare dependencies in specially formatted comments in the JavaScript files, and have all the required files concatenated server side. (Read more here: http://getsprockets.org/)

Where I work, we have a real need for such a framework, but it has to be in the form of a Java library.

Does such a thing exist? What other solutions have you come up with to manage JavaScript dependencies?

+1  A: 

You can also use juicer to merge javascript files although it's also written in ruby.
Another option that, I suppose, will suit you is using combiner by Nicholas C. Zakas if you do not need all the features of juicer and sprockets. It is pretty simple, written in java (.jar) and the source can be found in author's repository. You can also fork the source in order to tune it according to your needs.

Li0liQ
I had a look at combiner. It seems to do exactly what I am looking for :-) The source is available on GitHub: http://github.com/nzakas/combiner/tree/master/src/net/nczonline/web/combiner/
KaptajnKold
+1  A: 

Such a feature exists in the Wicket framework. It is a component-oriented web framework for Java that is gaining momentum these days.

Wicket lets you define header resources in your components (eg, Javascript scripts, CSS files, etc.) and combines them at runtime, removing duplicates.

Olivier Croisier
Does this feature in Wicket come as a standalone library? We already have a large web app which uses Tapestry/Spring/Hibernate.
KaptajnKold
Unfortunately, I think it doesn't.
Olivier Croisier