There are multiple minification and obfuscation frameworks out there. One has a greater compression ratio then the other, but for me the most well know ones are probably:
<ol><li>Dojo Shrinksafe - Rhino based compressor from the Dojo Toolkit
</li><li>YUI Compressor - Rhino based compressor by Yahoo
</li><li>JSMin - a whitespace compressor by Douglas Crockford
</li></ol>Since Apache Cocoon comes with a version of Rhino and both #1 and #2 have their own version of Rhino included, this could end up having nasty conflicts because of two different versions of the library on the same classpath. Therefore I chose to write a reader based on JSMin, which does a lot of whitespace compression for you.
The implementation of this reader was quite simple and if you’re interested, you can get the source here. Do keep in mind that you will have to have the JSMin.java file also on the classpath, otherwise it wil not work.</div>