Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Deploy to Intellij IDEA Tomcat Folder?

I use Intellij IDEA 11.1.2 Ultimate Edition. I run Tomcat 6 from Intellij IDEA. Beside my .war application I have another folder that has static HTML files. When I run tomcat manually from command line I put that folder under Tomcat's webapp folder and it automatically deploys it and works. However I want to debug my application so I want to run Tomcat from Intellij IDEA. I think that Intellij IDEA deploys tomcat applications into .IntelliJIdea11\system\tomcat folder. Where I can put my folder that contains static files when I run Tomcat from Intellij IDEA?

(I request the main page of static HTML file folder within an iframe at one of my HTML pages of .war file )

Any ideas?

like image 819
kamaci Avatar asked Oct 18 '12 07:10

kamaci


People also ask

Where does IntelliJ deploy Tomcat?

Tomcat deployment directory Follow x), located in R:\programs\apache-tomcat-6.0.

Where is Tomcat deploy directory?

A web application can be deployed in Tomcat by one of the following approaches: Copy unpacked directory hierarchy into a subdirectory in directory $CATALINA_BASE/webapps/ . Tomcat will assign a context path to your application based on the subdirectory name you choose.


2 Answers

Tomcat Run configuration has an option to deploy other applications from the server (that already present in the original webapps folder), like your static files:

deploy

Another option would be to create a second module for the static content with another artifact and deploy both artifacts from IntelliJ IDEA.

like image 200
CrazyCoder Avatar answered Oct 05 '22 03:10

CrazyCoder


I think that CrazyCoder's answer is a little bit better. But here is my solution.

  • Go to File -> Project Structure...
  • Select your Web facet
  • In section Web resource directories click to +
  • Web resource directory path is your static content
  • Relative path in deployment directory is where you want to find it in your application war

Project structure

like image 43
chalimartines Avatar answered Oct 05 '22 03:10

chalimartines