5

I use IntelliJ IDEA 13.1 and have configured a Java web application to deploy to a Tomcat server. After starting the server, if I go to my tomcat webapps folder, I couldn't see the exploded version of my web app there.

So, do IntelliJ keep the deployed files somewhere else other than the tomcat webapps folder?

Btw, I did check the answer for this question: Where is my app placed when deploying to Tomcat?. But I couldn't find my deployed files in the ${dir.to.idea.project}\YourWebApp\out\artifacts folder either.

Any help?

Community
  • 1
  • 1
Veera
  • 32,532
  • 36
  • 98
  • 137
  • Your project workspace is your webapp. – adarshr Jun 20 '14 at 15:36
  • possible duplicate of [Where is my app placed when deploying to Tomcat?](http://stackoverflow.com/questions/10461702/where-is-my-app-placed-when-deploying-to-tomcat) – Sled Aug 20 '14 at 21:42
  • 1
    My own similar Question with good Answers: [Where is the “server log” for Tomcat when running externally from IntelliJ Ultimate?](https://stackoverflow.com/q/45666791/642706). For example, I found my web app deployed here on macOS for a project named 'timepiece': `/Users/basilbourque/Library/Caches/IntelliJIdea2017.2/tomcat‌​/Unnamed_timepiece_3‌​`. To learn your location, search for `CATALINA_BASE` in your console output, as seen in [this screen shot](https://i.stack.imgur.com/AVgmV.jpg). – Basil Bourque Aug 14 '17 at 05:25

2 Answers2

2

Typically the exploded war is built in your web-module's target directory (called either target or out by default depending on whether you use maven or not), with a .war extension on the folder. Tomcat (and most other application servers) are pointed at this directory.

However, you shouldn't, in most cases, need to know this. When you make a change to your code, IntelliJ will update the contents of the exploded war for you. You shouldn't really change it yourself, otherwise the code will get out of sync with the deployed app.

Software Engineer
  • 15,457
  • 7
  • 74
  • 102
  • 1
    If your project structure is correct, then you should be able to get automatic redeployment working. I work with IntelliJ everyday building webapps, and automatic redeployment of javascript, html, and css changes happens without fault. Check your run config for the server, and see if you have `Update Resources` selected as the action to perform On Frame Deactivtion. As long as you have your webapp directory marked as such this should automatically copy your static files to the exploded war whenever you switch to your browser (although it often takes a couple of seconds). – Software Engineer Jun 20 '14 at 15:52
0

I'm using gradle and the deployed wars are in project_root/.build/package/modules/.

If this doesn't help,here is how I found out.

While the project is running I run the gradle clean task, then tomcat kindly complained

java.io.FileNotFoundException: /project_root/.build/package/modules/exploded/my.war/WEB-INF/lib/xxx.jar (No such file or directory)` How sweet of it.

I hope this helps!

Amanuel Nega
  • 1,899
  • 1
  • 24
  • 42