一、maven安装
jdk已安装
路径:F:\apache-maven-3.6.0
系统变量:
M2_HOME = F:\apache-maven-3.6.0
M2 = %M2_HOME%\bin
MAVEN_OPTS = -Xms256m -Xmx512m
path添加:%M2%
配置仓库位置:F:\apache-maven-3.6.0\conf 下 settings.xml
添加:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>E:\MyLocalRepository</localRepository>
mvn archetype:generate创建项目,可能会卡很久,解决方法:http://repo.maven.apache.org/maven2/archetype-catalog.xml
下载 archetype-catalog.xml,放到 E:\MyLocalRepository\org\apache\maven\archetype\archetype-catalog\3.1.0下,默认位置是:C:\用户\.m2\repository\org\apache\maven\archetypes\maven-archetype-archetype\1.0
mvn archetype:generate -DgroupId=com.companyname.bank -DartifactId=consumerBanking -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -DarchetypeCatalog=local