Solve the problem of importing Web projects into Idea and publishing them to Tomcat

Solve the problem of importing Web projects into Idea and publishing them to Tomcat

Idea imports an existing web project and publishes it to Tomcat, but finds that Tomcat does not publish automatically

question:

When importing a web project, idea does not treat it as a web, so you need to modify the project structure yourself

1. Import the project

Open File->Open...

2. Found that the icon in front of the project web does not have a small dot

The correct answer should be:

3. Configure and run

(1) Configure the operating environment

Open Run->Edit Configurations...

(2). Click the small plus sign in the upper left corner

(3). Select local Tomcat and find the directory

(4) When you select Deployment, there is nothing. You will see a red exclamation mark below (thinking things are not that simple). Select Add.

(5) Select Build Artifacts

Emmm... Sure enough, I can't add the currently imported project

You can only add Tomcat first (it can't run yet)

Solution:

1. Open Project Structure..., or use the shortcut key: Ctrl+Alt+Shift+S

Found that there is no SDK, quietly added it (but this is not the problem)

2. Select Modlues and find that this module exists, but we want to remove it now

A warning pops up, which roughly means: Remove the only module of the project, it will not be deleted on the hard disk

3. Re-import

From the storage

Create a new module in the resources, and then follow the next

4. After clicking Finish, you will find that the small icon in front of the web has a small dot, which means that Idea treats it as a web project

5. Continue to open Project Structure..., select Facets, and you will see the project name

If not

If yes, add one

6. Select Artifacts to add the module

7. Continue back to the configuration run, select the Tomcat created previously, and click the "+" below

(I later realized that I didn’t need to add it here. Just select Deployment and add Artifects, and it will be automatically added here.)

Build Artifacts

After adding

Select Deployment->+->Artifact...

After adding

8. Start Tom Cat! ! !

Report an error...

After clicking OK, you will jump to Project Structure (if not, you need to open it yourself), and find that Project Compiler output is empty. Create a new out folder under the project and specify this folder

Start again! ! !

Dependency not found...

After adding, start...normal...

At this point, the problem is solved.

Summarize

The above is what I introduced to you about solving the problem of importing Web projects into Idea and publishing them to Tomcat. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to import Eclipse projects into IDEA and run them (very detailed)
  • How to import other people's springboot projects in idea (picture and text)
  • IDEA project dependency (pom.xml file) import problem and solution
  • How to import local jar packages in IDEA Maven project
  • Detailed steps and precautions for importing geoserver projects into IDEA

<<:  MySQL 8.0.12 installation and environment variable configuration tutorial under win10

>>:  Vue-Element-Admin integrates its own interface to realize login jump

Recommend

Introduction to new ECMAscript object features

Table of contents 1. Object properties 1.1 Attrib...

The latest version of MySQL5.7.19 decompression version installation guide

MySQL version: MySQL Community Edition (GPL) ----...

Related operations of adding and deleting indexes in mysql

Table of contents 1. The role of index 2. Creatin...

Teach you step by step to configure MySQL remote access

Preface When using the MySQL database, sometimes ...

CSS+HTML to realize the top navigation bar function

Implementation of navigation bar, fixed top navig...

How to smoothly upgrade nginx after compiling and installing nginx

After nginx is compiled and installed and used fo...

JavaScript canvas to achieve raindrop effects

This article example shares the specific code of ...

Detailed explanation of the execution principle of MySQL kill command

Table of contents Kill instruction execution prin...

Example of using MySQL to count the number of different values ​​in a column

Preface The requirement implemented in this artic...

Functions in TypeScript

Table of contents 1. Function definition 1.1 Func...