IDEA 2018版 Maven配置
apache-maven-3.6.3 和 apache-maven-3.6.2 不兼容。导致奇怪错误。
apache-maven-3.6.1配置后OK
另Maven配置
<localRepository>E:\Maven\repository</localRepository>
<mirrors>
<mirror>
<id>Central</id>
<url>http://repo1.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!--阿里云镜像-->
<mirror>
<!-- 唯一标识一个mirror -->
<id>alimaven</id>
<!-- 代表了一个镜像的替代位置,例如central就表示代替官方的中央库 -->
<mirrorOf>central</mirrorOf>
<!-- 貌似没多大用,相当于描述 -->
<name>aliyun maven</name>
<!-- 是官方的库地址 -->
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>net-cn</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://maven.net.cn/content/groups/public/</url>
</mirror>
<!--默认的中央仓库-->
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!--自定义添加-->
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
</mirrors>
其中http://repo1.maven.org/maven2的镜像放在最前面。
推荐配置:设置maven在不联网的情况下使用本地插件
一般使用maven为我们提供好的骨架时,是需要联网的,配置这个,可以在没有网路的情况下,我们可以正常创建工程,并从之前已经使用过的工程中找到相应的骨架。
输入内容:-DarchetypeCatalog=internal