Question: In our company, we have a number different modules constructed as separate wars. 
Each client can pick and choose module he wishes to buy.
Since all modules share same session, security context etc, it makes sense to merge them into a single war. 

Is it possible to automate this process? For example, it should merge web.xml, calculate each wars dependencies, copy files like .jsp and .class etc. By the way, we are using Maven, but were not able to find a solution to this problem.

Answer: 
EARs are designed to hold multiple things. Would this be a possibility for you?

---

Edit: First of all, lets assume that there is no duplicate resources (which one should go in the final jar?) and that all jars are compatible (you only have one version of each library etc.).

You should be able to just copy the content of WEB-INF/ on top of each other, except the various XML files which need to be carefully merged. The easiest way to do this is probably by using a XSLT style sheet which allow you to hold two XML documents and merge them (if I recall correctly this is the tag). you will need one for each xml file in order to be CERTAIN that you do this correctly - just think about JSF navigation.

So, my suggetsion is a simple copy of resources and a hand crafted XSLT style sheet pr xml configuration file.
You might be able to get something working with One-Jar. 

<http://one-jar.sourceforge.net/>

It probably doesn't do everything you want.