zengkid / SmartTomcat

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

Tomcat deploy path considering target/classes instead of actual war folder #122

Open marcelocastrillo opened 8 months ago

marcelocastrillo commented 8 months ago

Describe the bug I'm deploying a java app that has a webapp folder. Inside that webapp folder, we have a web-inf folder where we drop some files that we need in runtime. Then in the app we access them via: BirtEngine.class.getProtectionDomain().getCodeSource().getLocation().getPath() (BirtEngine is a class of the app). But the problem is that instead of getting path of the generated folder via maven, it takes as path /target/classes

Intellij & SmartTomcat Version (Help -> About copy & paste below) IntelliJ IDEA 2023.3.3 (Community Edition) Smarttomcat 4.7.2

yuezk commented 7 months ago

Got your point. This happens because the plugin is trying to collect the class path from different folders (e.g. the Maven output folder) and virtually mount them to WEB-INF/lib or WEB-INF/classes. Since the output folders usually have a higher priority, you could get the target/classes as the result.

But sadly, I didn't come with a solution for this.