Intellij tomcat local run configuration - what hap

2019-01-27 09:08发布

I've been using tomcat run configuration without any problems - it does a excellent job. However I kind of don't like the fact that it is not documented anywhere (or is it?) how this magic actually happens.

I suppose it somehow makes tomcat reference app created from artifact within target directory (if using maven). I also noticed that when using manager-gui app there are no other applications deployed so it must not use tomcat/webapps dir.

What I am curious is:

  1. How does it start tomcat to point at the application outside tomcat home?
  2. Does it deploy my app using {project_dir}/target/{appName}?
  3. Where is the manager-gui app?
  4. Where are the logs and conf files?

1条回答
淡お忘
2楼-- · 2019-01-27 09:34

I'm using IntelliJ IDEA 15.0.3, Tomcat 8.0.15 and JDK 1.8.0_31

This is an excerpt from C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\bin\idea.properties:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.system.path=${user.home}/.IntelliJIdea/system
idea.system.path=D:/dev/IntelliJ-Settings/system

In File --> Settings... --> Build, Execution, Deployment --> Application Servers I've defined this: (look at Tomcat base directory)

enter image description here

D:\catalina-base-idea contains the global Tomcat configuration for IntelliJ.

When I deploy my webapp using IntelliJ run configuration, the web app will be deployed to D:\dev\IntelliJ-Settings\system\tomcat (see idea.properties).

The above explains question 1.

Question 2: afaik, target is only used for building, not for deploying.

Question 3: there is no manager app within D:\dev\IntelliJ-Settings\system\tomcat\webapps

Question 4: logs are within D:\dev\IntelliJ-Settings\system\tomcat\webapps\yourApp . The global Tomcat config is located in D:\catalina-base-idea.

You can configure the Tomcat for IntelliJ so that it uses a port other than 8080. So you can start your standard Tomcat and IntelliJ Tomact at the same time.

查看更多
登录 后发表回答