Mike3355
Mike3355

Reputation: 12081

Running a Spring MVC program in Intellij

I am a past Eclipse user and been using Intellij for 2 months on. However I am only been using it for Spring-Boot apps. I decided to make a fun Spring MVC app and I cannot figure out how to get it to deploy and run on my tomcat server. For spring boot it is pretty simple.

I was hoping someone could help me out with this.

enter image description here

The above picture show my options. I am using Intellij 14 full version if that matters.

Hope to hear from someone soon.

Upvotes: 3

Views: 11160

Answers (4)

Abe
Abe

Reputation: 686

No need to install tomcat server locally. You can use Tomcat7 Plugin in your pom and run it without any other configuration.

enter image description here

Upvotes: 0

Abhishek Sengupta
Abhishek Sengupta

Reputation: 3291

We can use Tomcat7 Plugin for running our App on IntelliJ

Follow this steps :

  1. Click on Add Configuration

enter image description here

  1. Click on +

enter image description here

Upvotes: 3

Mustafa
Mustafa

Reputation: 2487

You need to create a configuration for your Tomcat Server first.

Here's a screenshot for where to find it.

If you don't see TomcatServer option when you try to create a configuration, you might need to enable Tomcat and TomEE Integration Plugin first by going to File -> Settings -> Plugins.

After you create a configuration for your server, you should be able to see options to run your spring application in the server.

You may also modify/configure how to run your app in the Deployment tab in your Tomcat configuration.

Upvotes: 2

Andrey Saleba
Andrey Saleba

Reputation: 2197

  1. You need to package it using some tool or IDE.

  2. And then to deploy result package to your tomcat server with Idea plugin or any deploy tool you like.

    Also you can configure maven to do both targets easily.

Update: you can choose your Tomcat/TomcatEE goal in menu like at your screenshot and provide required server info here like host, port, etc.. And on the deployments page add your application artifact. And then save this build profile and use it with run>>run in main menu of IDE

Upvotes: 0

Related Questions