在Eclipse中创建maven项目

一、打开eclipse,我这里使用的sts(跟eclipse一模一样)。

二、点击window->preferences->maven->installations->add

在Eclipse中创建maven项目

 点击directory,选择maven根目录即可(不用到bin目录)。

点击apply。

打开conf/setting.xml    添加

<localRepository>D:Mavenapache-maven-3.6.3maven-repo</localRepository>

并在maven目录中创建maven-repo文件。

并添加镜像:

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

回到eclipse,点击users settings,点击

在Eclipse中创建maven项目

 点击OK。

然后创建maven project。

在Eclipse中创建maven项目

 点击next。

在Eclipse中创建maven项目

 点击next。(quickstart是创建普通项目,webapp是创建web项目)。

在Eclipse中创建maven项目

 finish即可。