Tomcat deployment directory


I have a webapp which is deployed to a local Tomcat (6.0.x), located in R:\programs\apache-tomcat-6.0.36.
I want IntelliJ IDEA to deploy the webapp to the \webapps subdirectory of the aforementioned one instead of the default

C:\Documents and Settings\bdusausoy\.IntelliJIdea12\system\tomcat\Unnamed_Coordleg

When Tomcat is launched, it prints its environment variables :

Using CATALINA_BASE:   "C:\Documents and Settings\bdusausoy\.IntelliJIdea12\system\tomcat\Unnamed_Coordleg"
Using CATALINA_HOME:   "R:\bdusausoy\programs\apache-tomcat-6.0.36"
Using CATALINA_TMPDIR: "R:\bdusausoy\programs\apache-tomcat-6.0.36\temp"

So basically I want IntelliJ IDEA to deploy to


How can I achieve this ?


Comment actions Permalink


why do you need this? If you want the application to remains deployed when you exit IDEA, you can setup a war artifact configuration with 'webapps'
directory as an output directory and build that artifact using Build | 'Build Artifacts' command.

Nikolay Chashnikov
Software Developer
JetBrains, Inc
"Develop with pleasure!"

Comment actions Permalink

Well, if I need this it's because of the weird environment we deploy in.
The application searches a properties file located in the CATALINA_BASE/etc directory.
That's why I'm trying to force the CATALINA_BASE variable to point to the right directory, which should be the same as CATALINA_HOME in my case.

It works well in Eclipse since you can take the full control of the deployment - that is you can deploy directly in the webapps subdirectory of your Tomcat installation and it simply launches it with the default environment variables that you can, if needed, overwrite.

So I thought I could do the same with IntelliJ IDEA.

I came across this post but this solution is messy.

Comment actions Permalink

I have same problem.
The reason, why i need to set 'CATALINA_BASE' manually is next:

Tomcat logs files location based on CATALINE_BASE.  Then, it will be located at ~/.IntelliJIdea12/system/tomcat/AccountWeb_(1)_server_2/logs

I have several project versions on same computer with different revisions. But logs directory is the same for all versions, it is collision. I want to put them in project copy locally.

Second reason is shared run configuration files, which contains log entries. This configuration files shared across the team in version control, so one member can have  ~/.IntelliJIdea12/system/tomcat/AccountWeb_(1)_server_2/logs, but another member have C:\Documents and Settings\bdusausoy\.IntelliJIdea12\system\tomcat. Then we have collisions in version control.


Please sign in to leave a comment.