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?