In the previous session, we created the MAVEN Web project with idea, and then we published the project to Tomcat and jetty to run it for further development and debugging
Configure Tomcat
First, open the menu bar
Second, click the Settings button, add the application server, select Tomcat Server
Select the Tomcat directory
Add the following as shown below
We have added the Tomcat server to idea, and then we have to set up the deployment information for the MAVEN Web project.
Third, set up the deployment file
CTRL + SHIFT + ALT + S Shortcut Open Project Structure
Set Modules:
Check the directory of files to be run in Tomcat
Add a Dependency package
Click Apply
The effect is as follows:
To add an artifact:
To make it effective:
Fourth step, deploy the project to Tomcat
Click Run on the menu bar
Find Tomcat
Add a deployed artifact
Select browser
Fifth step, run Tomcat
Configure Jetty
Jetty is a lightweight application server, more suitable for our development debugging, its configuration is similar to Tomcat, first to the Jetty official website Download (https://www.eclipse.org/jetty/download.html), to find the corresponding JDK version of the download, my JDK is 1.7
Add Jetty Server
Select Jetty Directory
To add a jetty server to the run configuration, click Run on the menu bar:
Add a deployed artifact
Change the jetty configuration file
When doing jetty configuration, idea will error, is JMX (Java Management Extensions, that is, Java Management extension) of the error, online check is said to be in the jetty configuration file plus:--MODULE=JMX, Should be used as a declaration that allows idea to call the jetty container. On the file Start.ini of the jetty home directory,
Once deployed, click Run
Summary: Just turned from eclipse a bit less suited to idea, after many operations familiar, slowly discovered that the idea is indeed more useful than eclipse. The above is about how to deploy the Web project, I began to grope for a long time, technology this thing there is no shortcut, a lot of practice a few times better.
IntelliJ idea use (ii): Tomcat and Jetty configuration