Deploying modules in a web application
I have a web application - deployed to Tomcat.
It has two modules Module A and Module B
Both have java code as well as a UI component (struts \ JSP etc.).
Functionally module A is independent and does not depend on module B For module A: We create a war for module A and deploy it as ModuleA.war
Now module B depends on module A We will "merge" the two modules in ModuleB.war this way This involves merging the web content directories into one
We felt uncomfortable with this merger process and wondering if there was a sane way to do this? We are also considering putting all web content in one of the modules - for example, module A and just store the Java code in ModuleB
Any suggestions?
a source to share
This is one of the problems with java. Let's say application A is a public website, let's say your application B is your admin but uses the same database, same bizlogic classes, etc. I found this problem all the time. My approach might help you.
module A will have classes specific to project A module B will have classes specific to project B mod A and B will share a .jar file that contains all related classes, you can deploy it to TOMCAT / lib or if you want to maintain it individually, deploy it in each MYAPP / WEB-INF / lib application
a source to share