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: 
It's clearly possible to do this, but I think that you would be better off working on a single WAR in the first place. Late "pick-and-mix" of WAR contents sounbds like a support nightmare to me.
You might be able to get something working with One-Jar. 

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

It probably doesn't do everything you want.