1.下载Maven安装包
http://maven.apache.org/download.cgi
2.配置环境变量
用户目录下,找到.bash_profile
配置
3.执行source .bash_profile更新
4.查看moven是否成功
mvn -version
5.增加国内镜像地址
maven安装包(apache-maven-3.5.2)->conf->settings.xml
增加国内镜像地址
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>ibiblio.org</id>
<name>ibiblio Mirror of http://repo1.maven.org/maven2/</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
<mirrorOf>central</mirrorOf>
<!-- United States, North Carolina -->
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
6.sts中配置maven
STS->偏好设置->maven->Installations->add
选择安装路径
然后UserSetting->Global Settings->Browse,选择maven的配置文件
7.新建测试工程
file->new->other->maven(maven project)->quickstart->finish