Ramil Huseynov
Ramil Huseynov

Reputation: 118

How to import existing Maven + Spring MVC + Tomcat project on Intellij IDEA?

I'm new to IntelliJ IDEA. I've imported project from git repository. Now I try to run it on Tomcat 8.5 with no success. I understand that I need to configure maven command to package my project in war file, but I do not know where to do it.

Upvotes: 2

Views: 2878

Answers (1)

Amit
Amit

Reputation: 32376

Import your project in Intellij.

Go to file->new->project from existing source-> then select the pom.xml from your project location on your disk. then follow the instruction given by IntelliJ.Check the box for maven to automatically download dependency for your project.

Create war from your code

Run mvn clean package from the directory where pom.xml is present. it will create war file in the target folder of same folder, where pom.xml is present.

Create war file from idea

Click on the right most icon of maven project in idea and there you will see different maven lifecycle, click on package to create war file of your project. again same war file will be available inside the target folder of your project.

follow below images for more clarity:-

create war file from intellij

target folder inside which war is present

Upvotes: 5

Related Questions