Reputation: 61
My setup is IntelliJ 15 Ultimate installed on MacOS (Yosemite) with a Tomcat 8 configuration.
I've got my webapp working - no issues there - when I open up a browser at http://localhost:8080/ this all works fine. However when I go to /usr/local/Cellar/tomcat/8.0.27/libexec/webapps I don't see the .war file of the project I am using.
I'm expecting to see something like MavenTomcatServlet.war. Having read a few posts on here, I've found that IntelliJ deploys to /Users/c1900406/Documents/development/MavenTomcatServlet/target (this is defined as default in the Tomcat run configuration I have) - and things seem to work with this configuration. enter image description here
My question is, since this war is not in the webapps folder, how does Tomcat know about this file and read it?
Is this configuration good practice? Or should IntelliJ be configured to place war files in the webapp directory?
Upvotes: 1
Views: 465
Reputation: 3859
Although it is possible to change the Tomcat webapp directory or change the context path of an web application, I don't think IntelliJ IDEA is doing that.
Note that Tomcat has several different ways of deploying webapps and most probably IDEA is using one of them, most probably using JMX (the Tomcat plugin is not open source and I couldn't information of its internals).
The screenshot you provided shows where the artifact output folder is (where the war is put after being build). IDEA simply passes this path to the Tomcat deployer.
Upvotes: 1