SmartTomcat icon indicating copy to clipboard operation
SmartTomcat copied to clipboard

Is it possible to run multiple app in the same tomcat share the same port ?

Open kuchaguangjie opened this issue 1 year ago • 7 comments

For new seems need to start a separate tomcat for each app, and with different port. Wondering is it possible to start a tomcat, then add/remove multiple apps in the same tomcat?

kuchaguangjie avatar Apr 04 '23 22:04 kuchaguangjie

Currently, there is no straightforward way to achieve this. I had planned to support multiple apps. But I don't have a clear idea of how to express it in the plugin UI. Multiple applications support could make the configuration UI more complex. If there is any clear way to describe it, I could implement it. And I would like to hear your voice and suggestions.

yuezk avatar Apr 06 '23 05:04 yuezk

Seems tomcat & tomee plugin, that comes with IDEA by default already support multiple deployments by default.

tomcat

kuchaguangjie avatar Apr 11 '23 05:04 kuchaguangjie

Hello, I have a maven project containing 2 apps composed of many maven sub projects. When I try to deploy one app with Smart Tomcat, startup fails because it tries to use the code of the 2nd app too (duplicated Spring beans). How to solve this issue ? Same code structure works with Eclipse or VS Code.

Isukthar avatar Nov 03 '23 17:11 Isukthar

@Isukthar Does the first app depend on the second one?

yuezk avatar Nov 06 '23 01:11 yuezk

My project contains maven projects : APP1, APP2, LIB1, LIB2, LIB3 APP1 is an app (war) depending on LIB1 and LIB3 APP2 is an app (war) depending on LIB2 and LIB3 LIB1, LIB2, LIB3 are local maven project building a java lib (jar)

There is a bean present in LIB1 and LIB2. When I deploy APP1 on SmartTomcat, there is a conflict between the bean from LIB1 ans LIB2, whereas LIB2 is not a dependency of APP1. Looks like when I launch SmartTomcat, all projects are deployed.

Thanks

Isukthar avatar Nov 06 '23 08:11 Isukthar

@Isukthar The problem could be that this plugin cannot detect the relevant modules automatically. You can try to configure the modules manually on the plugin's configuration page.

image

If several modules are in the dropdown menu, you can try it several times to select the best one.

yuezk avatar Nov 07 '23 05:11 yuezk

All my maven projects are in the list, but no mater the project I select, the issue is the same.

Isukthar avatar Nov 07 '23 10:11 Isukthar