To use SpringBoot, you must first configure the maven environment

To use SpringBoot, you must first configure the maven environment

Because SpringBoot is a dependency introduced by the maven used, it is necessary to configure the maven environment first when using SpringBoot, which is divided into three main points

First point

The location of the custom local warehouse is as follows:

Insert picture description here

The second point

Use Ali mirror warehouse to improve download speed, as shown below:

Insert picture description here

The third point

Configure the maven environment in IDEA, as shown below:

Insert picture description here

If you do not configure the maven environment for IDEA, you will find the following error message when updating the pom.xml file, as shown in the figure below:

Insert picture description here

Update pom.xml after configuration, you will find that all errors disappear, as shown below:

Insert picture description here

The reason for the warning red line in the package in Dependencies and how to deal with it

In the maven project, if there is a warning red line under the package in Dependencies, as in the picture below, there is a warning red line under the mybatis-plus-boot-starter package of version 3.0.5, which may be because the local warehouse is downloading this version of the package When half of the download was disconnected, the download of this version of the package was not completed, only half of the download was completed, but after the network was reconnected, there was already a 3.0.5 version of the package in the local warehouse (although it was only a broken package), so The local warehouse will no longer re-download the 3.0.5 version of the package. If you want to use the mybatis-plus-boot-starter package, you can only re-download it with a different version. Note that the network cannot be disconnected during the download.

The broken version is shown below:

Insert picture description here

It can be found that there will be a warning red line below the broken version of the package.

Re-download a full version as shown below:

Insert picture description here

It can be found that after re-downloading the full version, the warning red line under the package disappeared.

Guess you like

Origin blog.csdn.net/qq_45950109/article/details/112480015