Import an eclipse-written Web project into idea deployment to Tomcat

Source: Internet
Author: User

It is divided into two major steps: Project configuration and Tomcat configuration.

First, the project configuration

Open idea, select Import Item

  

After selecting the project path to be opened, continue to select the project's original type (subsequent boot settings will be updated to the idea project based on the original project type), in this case select Eclipse, and then keep next

    

File->project structure open the Project configuration window

To configure JDK versions and compilation levels in project items

  

Configure the project structure in the Sources tab of the modules item (main configuration Java files and configuration files to be compiled

   

Configure the post-compilation file output path in the Paths tab of the modules item

  

  

Configuring dependencies in the Dependencies tab of the modules item

Because the Eclipse project was selected when importing the project, the dependencies are handled automatically here, if the manual configuration is primarily a jar package with JDK and web-inf/lib.

There is a red wavy line error in the item name indicated in the picture, and all the red items in the dependency are deleted (some of the red Eclipse related items in the figure are because the project was originally opened in Eclipse, which is not required in idea).

  

Configure the required libraries in the Libraries key. Because the project needs to use JSP and servlet, and there is no relevant jar package in the project Lib, we introduce Js-api.jar, Servlet-api.jar in the Tomcat_home/lib directory.

  

To add a Web module to a project in the facets item

  

Modify the Web resource by clicking on the location indicated in the image. Idea default directory is the Web, our project is Webroot, so note the need to modify here.

  

To set the deployment configuration for a project in the artifacts key

Add webapplication:exploded

  

Can be further configured if necessary, is added after the default configuration no more Settings

  

Second, Tomcat configuration

Click on the icon in the upper right corner of the interface to open the run environment configuration

  

  

Add Tomcat Runtime Environment

  

Configure the Tomcat path, port

  

Add the project you want to deploy in the Deployment tab, and you can see that the deployment operation adds "Build ' Epcsys:war exploded ' artifact"

  

  

Click to run Tomcat when the Tomcat configuration is complete

  

Import an eclipse-written Web project into idea deployment to Tomcat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.