LuckyLuke
LuckyLuke

Reputation: 49077

Where is my app placed when deploying to Tomcat using IntelliJ IDEA?

I am deploying an application from IntelliJ IDEA to the local Tomcat server. I thought the apps you deploy are placed in the webapps folder, however it does not turn up there.

Is this correct? Where is it?

Upvotes: 41

Views: 48928

Answers (9)

Florian F
Florian F

Reputation: 1377

When you start your tomcat, the very first lines in the console tell you all you need. For example:

C:\opt\local\apache-tomcat-8.5.85\bin\catalina.bat run
[2023-09-25 02:08:23,777] Artifact Gradle : ch.hcuge.dpi : yourapp.war    (exploded): Waiting for server connection to start artifact deployment...
Using CATALINA_BASE:   "C:\Users\(user)\AppData\Local\JetBrains\IntelliJIdea2023.2\tomcat\8f03b7c3-fe03-4abd-bfc1-b30021a4aa53"
Using CATALINA_HOME:   "C:\opt\local\apache-tomcat-8.5.85"
Using CATALINA_TMPDIR: "C:\opt\local\apache-tomcat-8.5.85\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk-11.0.18+10"
Using CLASSPATH:       "C:\opt\local\apache-tomcat-8.5.85\bin\bootstrap.jar;C:\opt\local\apache-tomcat-8.5.85\bin\tomcat-juli.jar"
Using CATALINA_OPTS:   ""

CATALINA_BASE is where your project is deployed. The directory uses a random UUID as a name, but seems to remain the same between deployments. Besides, from the last modification date you can identify which directory was deployed last.

Upvotes: 1

Ron Trask
Ron Trask

Reputation: 1

I am still trying to track down my own issue which is a tangent off of this, but the information here helped me. However, the location of where Intellij puts the tomcat config files on a Mac has changed. As of 2023 I found the tomcat conf directory here:

~/Library/Caches/JetBrains/IntelliJIdea2023.1/tomcat/8d90d524-8dae-4654-af6d-8ce0573e0cb3/conf

The uuid in this case 8d90d524-8dae-4654-af6d-8ce0573e0cb3 probably ties the configuration to a specific project, because in my case there were multiple UUID directory I found the correct one via ls -lrt which lists the most recent directory last.

There seems to be some ambiguity on the where the application is actually deployed, because the server.xml file also points to the tomcat installation webapps directory. By experiment, I believe that exploded install is left in the target directory.

Upvotes: 0

naXa stands with Ukraine
naXa stands with Ukraine

Reputation: 37926

If you are using Intellij IDEA your artifacts are deployed directly from output directory: ${project.dir}\${web.module}\out\artifacts or ${project.dir}\${web.module}\target if you're using Maven and follow Standard Directory Layout.

Tomcat configuration is in different folder:

Mac:     /Users/${user}/Library/Caches/IntelliJIdea${version}/tomcat/  
Linux:   /home/${user}/.IntelliJIdea${version}/system/tomcat/
Windows: C:\Users\${user}\AppData\Local\JetBrains\IntelliJIdea${version}\tomcat

Upvotes: 19

Pool
Pool

Reputation: 12342

From IntelliJ 2020 onwards the Tomcat configuration and work directories have moved to:

C:\Users\${user}\AppData\Local\JetBrains\IntelliJIdea${version}\tomcat

Upvotes: 15

mike
mike

Reputation: 111

The server log output the env variable "CATALINA_BASE" which contains the exploaded location

Upvotes: 3

alan9uo
alan9uo

Reputation: 1131

I am new to IntelliJ IDEA. In my config. I add a local tomcat server. My tomcat container is run the project's target folder.

${your project's path}\target\ ${your project's name}

In this path ,you will find the file that IDEA has build. And tomcat server would run this folder.

Upvotes: 1

Paulius Matulionis
Paulius Matulionis

Reputation: 23415

Yes, If you are using IntelliJ IDEA the application does not turn up on Tomcat webapps directory. Your artifacts are in directory, for example:

${dir.to.idea.project}\YourWebApp\out\artifacts

This is default directory created by IntelliJ.

Tomcat configuration is in the different folder. I am using windows 7. So it is:

C:\Users\User\.IntelliJIdea10\system\tomcat\YourApplicationName

Upvotes: 29

Software Engineer
Software Engineer

Reputation: 16120

If you're following the standard maven approach, which is highly recommended, then your output goes to the target directory, not out. With the maven approach you'll probably have multiple modules under your project root, and the target directory will be found under each module. The web application is then built into an exploded directory named after the module, but with .war as an extension. So, you have:

project/module/target/webapp.war

Upvotes: 5

dewtea
dewtea

Reputation: 476

Just for reference, the corresponding folder on a mac (for IntelliJ 13) is:

/Users/<username>/Library/Caches/IntelliJIdea13/tomcat/

Upvotes: 31

Related Questions