Running a Spring MVC program in Intellij - spring

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.
The above picture show my options. I am using Intellij 14 full version if that matters.
Hope to hear from someone soon.

We can use Tomcat7 Plugin for running our App on IntelliJ
Follow this steps :
Click on Add Configuration
Click on +

You need to create a configuration for your Tomcat Server first.
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.

You need to package it using some tool or IDE.
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

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

Related

can you help me fix my STS? as it is not working

I am new to STS and trying to run my first project in it. But it is not showing me run on server option. I have tried "clean install" but still, it is not working. When I checked targeted runtimes it is not showing any server in it. Kindly help me to resolve this issue.
My recommendations for getting started with the Spring Tools 4 for Eclipse are:
start the IDE with an empty workspace
create a new Spring Boot project using the wizard "Import Spring Getting Started Content" to import some getting started guides, for example the Rest Service example
if you decide to create an empty new Spring project, use the wizard "Spring Starter Project" - it is the direct integration for https://start.spring.io - and go from there
All those options get you started with a Spring Boot project which doesn't need a separate server to run on. Spring Boot comes with am embedded server component, so you can just start the Spring Boot application as a regular Java app. No need to install a local server or use the "Run on Server" option in the IDE.

Can I configure SpringBoot app to run on a tomcat that is added to eclipse IDE in its servers tab?

I am trying to create a spring boot web app. But i dont want to create a jar out of it.
I want to run the web app directly from eclipse on to the tomcat that is added to eclipse via servers tab.
Is it possible? How to achieve it?

Which are the easiest steps to enable log4j in a JAVA EE 7 (WAR) deployed on WildFly 10?

Everytime I don't use a template or have to upgrade old projects I get in troubles finding which is the easiest way to configure log4j for a WAR (EE 7) that will be deployed on WildFly 10...
I'm using maven
Can anyone help me ?
Thanks in Advance
I'd suggesting leaving the log4j.xml out of the deployment and configuring logging through the logging subsystem. This would allow you to make changes to the configuration at runtime without requiring a redeploy of the application or reload of the server.
For example to add a new logger with the DEBUG level in CLI:
/subsystem=logging/logger=org.jboss.as:add(level=DEBUG)
If you now need want to change it to TRACE logging:
/subsystem=logging/logger=org.jboss.as:write-attribute(name=level, value=TRACE)
You can also configure all this through the web console or the HTTP management API as well.

What is my webserver webapp directory?

I'm new at Maven and I'm following a tutorial where I learned how to create a Maven web app and now I want to run it from Eclipse IDE. In this tutorial the last step is this:
I don't understand how can I find my webserver web app directory and how can I restart my webserver. Someone explaining me this?
Regards,
If you want to deploy your java webapplication to tomcat semi-automatically I suggest you to use the tomcat-maven plugin (section 3):
Tutorial on tomcat-maven plugin

How do I use eclipse spring IDE to create a Spring boot application that runs on wildfly?

I have my eclipse setup to use either wildfly or tomcat, but when I create a new spring-boot application, it defaults to tomcat, how can I change this? also, are there any other settings I'll have to modify? Everytime I configure spring core with jsf on wildfly there are a bunch of erros I have to deal with. I really don't like wildfly at all but have to use it for a new job.
Be sure you have installed JBoss tools plugin from Eclipse Marketplace.
Go right click on your project > Debug as (or Run as) > Run on server > Manually define a new server > Choose WildFly > Download and install runtime > Select desired version (i.e. WildFly 8.0).
Wait until WildFly downloads.
Next, next... Finish.. and your application should start on WildFly server.

Resources