Quickly build Springboot projects (solve the problem of slow downloading of Maven dependencies during construction)

	有不少人朋友肯定在构建Springboot项目时遇到了,Maven依赖包速度慢甚至下载失败的问题吧。
	在开始构建项目之前,配置好对应的Maven镜像问题就迎刃而解了。

1. Configure Maven domestic resource mirroring

(1) Find your Maven Setting.xml under your IDEA installation path and
insert image description here
find your corresponding IDEA installation path (the first 1 is my personal installation path, which is different for everyone. The latter 2 is the Maven path after IDEA is installed, which is basically fixed).

(2) Find the setting.xml under Maven, copy it to the .m2 folder of the system and copy the corresponding mirror configuration to setting.xml.
insert image description here
Some are shown below 内联代码片.

	<mirrors>
        <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>

2. Open IDEA and start building the Springboot project

(1) Open IDEA, click file->new->project->Spring initializr, select the corresponding configuration and click next if you don’t understand it.
insert image description here
(2) Fill in the corresponding organization name (package name), project name, etc., and click next
insert image description here
(3) Select the corresponding dependency package to be downloaded. If you don’t understand it, you can choose Spring Web. If you need to connect to the database, select the corresponding database driver, and then click next to complete the build. insert image description here
(4) After the build is complete, don’t worry about coding. Wait until the progress bar in the lower right corner (related dependency package download and configuration of some files) is finished reading before proceeding. If the progress bar is very slow or it shows that the dependency download failed, you need to perform the fifth step below to adjust the Maven image to domestic resources. (If you don't need it soon)
insert image description here
(5) Open file->build, execution, deployment->Maven, select the corresponding Maven version, and check the user setting file (the Maven setting configured at the beginning).
insert image description here
Finally, wait for the dependent packages to be downloaded before you can start writing the project.

Guess you like

Origin blog.csdn.net/JavaD0g/article/details/107371943