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

How to install Nginx in Docker

Install Nginx on Docker Nginx is a high-performan...

How to configure ssh to log in to Linux using git bash

1. First, generate the public key and private key...

A complete guide to the Docker command line (18 things you have to know)

Preface A Docker image consists of a Dockerfile a...

Installation and daemon configuration of Redis on Windows and Linux

# Installation daemon configuration for Redis on ...

How to solve "Unable to start mysql service error 1069"

Today, when I was on the road, a colleague sent m...

Detailed analysis of compiling and installing vsFTP 3.0.3

Vulnerability Details VSFTP is a set of FTP serve...

CocosCreator general framework design resource management

Table of contents Problems with resource manageme...

How to configure NAS on Windows Server 2019

Preface This tutorial installs the latest version...

The latest virtual machine VMware 14 installation tutorial

First, I will give you the VMware 14 activation c...

In-depth explanation of hidden fields, a new feature of MySQL 8.0

Preface MySQL version 8.0.23 adds a new feature: ...

win10 mysql 5.6.35 winx64 free installation version configuration tutorial

mysql 5.6.35 winx64 free installation version con...

Basic usage of find_in_set function in mysql

Preface This is a new function I came across rece...

Linux service monitoring and operation and maintenance

Table of contents 1. Install the psutil package S...

Solution to the ineffective margin of div nested in HTML

Here's a solution to the problem where margin...