I have built a sophisticated ajax-driven single page webapp that uses a RESTful backend web service serving JSON. The javascript is
Take a look at the yuicompressor-maven-plugin. It can aggregate various js (as well as css) files as well as minify and obfuscate them.