How to create two java-webapps and interdependent jar dependencies and other files?

We have a web application for web services (called ws-project). He uses 2 more projects:

  • dao-project (sleep mode)
  • core-project (pojo)

ws-project (war)  
 |   
 +--dao-project (jar)   
 +--core-project (jar)   

We use the maven and spring framework. (& eclipse)

We would like the second web project to display web pages using spring -mvc (& jsp)

web-project (war)   
 |  
 +--dao-project (jar)  
 +--core-project (jar)  

The problem is that we will have 2 web applications. And after deployment, each webapp will contain 2 jars in / lib (dao-project.jar and core-project.jar). Each of them will have its own data source and spring container called.

So, we are thinking of doing, as usual, only one website that mixes web services and web pages.

Any decision to have a clean split without these flaws?

, , .

+3
2

, J2EE (, EAR), , . . , Tomcat $CATALINA_BASE/shared/lib, .

+3

, .

-, JAR. JAR, - . ( ), - JAR.

- JAR, TOMCAT jar TOMCAT/lib ( webapp/lib), - ( , ). , Tomcat - $CATALINA_HOME/common/lib. Tomcat , " " .

, , . , , ? , , Singleton, -. , - JVM, - JVM.

+2

Source: https://habr.com/ru/post/1746219/


All Articles