zengkid / SmartTomcat

The Tomcat plugin for Intellij IDEA
Apache License 2.0
122 stars 56 forks source link

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

Open kuchaguangjie opened 1 year ago

kuchaguangjie commented 1 year ago

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?

yuezk commented 1 year ago

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.

kuchaguangjie commented 1 year ago

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

tomcat

Isukthar commented 10 months ago

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.

yuezk commented 10 months ago

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

Isukthar commented 10 months ago

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

yuezk commented 10 months ago

@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.

Isukthar commented 10 months ago

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