0
votes

I have a maven project that I deploy from IntelliJ to tomcat in exploded WAR form. However, after deployment, when I look in tomcat's webapps/ folder there's no deployed project files. Nothing. Absolutely nothing in webapps. No directory, no WEB-INF, no META-INF, nothing. Yet, the app runs fine.

I expect to see:

tomcat/webapps/myProject/WEB-INF/*

tomcat/webapps/myProject/META-INF/*

  1. Where are the files?
  2. If some kind of smart logic happens, what is it?
  3. Where is this logic stored? How does IntelliJ communicate with tomcat where the files are, to run the app?
1
They are stored in the location you've configured for the artifact output directory in IntelliJ IDEA: jetbrains.com/help/idea/artifacts.html.CrazyCoder

1 Answers

0
votes

I ran

ps aux | grep tomcat

And found that the tomcat command was run with this argument: So I checked in that directorya nd I see

<myUsername>$ ls -la /Users/<myUsername>/Library/Caches/IntelliJIdea2019.2/tomcat/Unnamed_lvsrules/conf
total 696
drwxr-xr-x  13 <myUsername>  110517844     416 Jun 15 15:06 .
drwxr-xr-x   7 <myUsername>  110517844     224 Jun 15 15:06 ..
drwxr-xr-x   3 <myUsername>  110517844      96 Jun 15 15:06 Catalina
-rwxr-xr-x   1 <myUsername>  110517844   12505 Apr  7  2016 catalina.policy
-rw-r--r--   1 <myUsername>  110517844    6362 Jun 15 15:06 catalina.properties
-rwxr-xr-x   1 <myUsername>  110517844    6455 Apr  7  2016 catalina.properties.0
-rwxr-xr-x   1 <myUsername>  110517844    1428 Apr  7  2016 context.xml
-rwxr-xr-x   1 <myUsername>  110517844    3352 Apr  7  2016 logging.properties
-rwxr-xr-x   1 <myUsername>  110517844    3129 Jun 15 15:06 server.xml
-rwxr-xr-x   1 <myUsername>  110517844    8414 Jun 12 17:46 server.xml.0
-rwxr-xr-x   1 <myUsername>  110517844    1566 Apr  7  2016 tomcat-users.xml
-rwxr-xr-x   1 <myUsername>  110517844  120879 Jun 15 15:06 web.xml
-rwxr-xr-x   1 <myUsername>  110517844  163213 Apr  7  2016 web.xml.0

So it looks like when IntelliJ is deploying to tomcat this way, it uses this temporary directory to store all the pointers to the libraries and compiled source files. In my case it looks like those pointers all point to files in my project's "projectName/target/projectName-..*-SNAPSHOT" directory.