zengkid / SmartTomcat

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

Configuration option for CATALINA_BASE #109

Closed meier123456 closed 1 year ago

yuezk commented 1 year ago

@meier123456 Thanks for your contribution.

What's the purpose of this PR? To configure the CATALINA_BASE, you can configure it in the VM Options field with -Dcatalina.base=/path/to/your/base. Or do you want to change the working directory?

meier123456 commented 1 year ago

It changes both, the "working directory" and CATALINA_HOME.

I have a directory continaing a carefully crafted tomcat configuration (my CATALINA_HOME). On startup the SmartTomcat plugin is creating a file in WORK_DIRECTORY/conf/Catalina/localhost that points to all the classfile directories. Without this file the Tomcat will not start the application to debug. However, Tomcat will not read this file unless CATALINA_HOME and WORK_DIRECTORY are the same directory.

Setting only -Dcatalina.base to something different from the WORK_DIRECTORY will not start the application. I do not see how such a configuration may be useful at all.

yuezk commented 1 year ago

It changes both, the "working directory" and CATALINA_HOME.

I have a directory continaing a carefully crafted tomcat configuration (my CATALINA_HOME). On startup the SmartTomcat plugin is creating a file in WORK_DIRECTORY/conf/Catalina/localhost that points to all the classfile directories. Without this file the Tomcat will not start the application to debug. However, Tomcat will not read this file unless CATALINA_HOME and WORK_DIRECTORY are the same directory.

Setting only -Dcatalina.base to something different from the WORK_DIRECTORY will not start the application. I do not see how such a configuration may be useful at all.

I understand that if I can make the work directory the same as the value of the -Dcatalina.base parameter, then your problem should be resolved, right?

meier123456 commented 1 year ago

Yes, both should point to the same directory. And the location of the directory has to be configurable.

yuezk commented 1 year ago

To make more sense, the getWorkingPath() should be renamed as getCatalinaBase().