1.Maven下载:Maven – Download Apache Maven
2.解压Maven zip包,配置settings.xml。在解压的Maven中找到conf->settings.xml,配置本地Maven仓库路径和国内Maven库镜像:
华为开源镜像站_软件开发服务_华为云 (huaweicloud.com)
以aliyun为例
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
保存关闭settings.xml。
3.eclipse配置Maven,Window -> preferences -> Maven->installations,添加下载的Maven路径
然后配置User Setting,如下:
4.创建Maven项目:在eclipse中File->New->Maven Project->next,勾选Create a simple project, 然后next,设置group id/artifactId/设置打包类型,Finish,完成项目创建。