Maven簡單配置

1. 本地倉庫位置修改

在<localRepository>標籤內添加本身的本地位置路徑maven

<localRepository>D:\Developer\repository</localRepository>

2. 添加國內鏡像源this

<!-- 阿里雲倉庫 -->
<mirror>
    <id>alimaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>

<!-- 中央倉庫1 -->
<mirror>
    <id>repo1</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://repo1.maven.org/maven2/</url>
</mirror>

<!-- 中央倉庫2 -->
<mirror>
    <id>repo2</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://repo2.maven.org/maven2/</url>
</mirror>

3. 修改maven默認的JDK版本

<profile>     
		<id>JDK-1.8</id>       
		<activation>       
			<activeByDefault>true</activeByDefault>       
			<jdk>1.8</jdk>       
		</activation>       
		<properties>       
			<maven.compiler.source>1.8</maven.compiler.source>       
			<maven.compiler.target>1.8</maven.compiler.target>       
			<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>       
		</properties>       
	</profile>

而後就是在IDEA中去配置maven,通常選中本地maven目錄,並覆寫IDEA的setting.xml文件便可。阿里雲

相關文章
相關標籤/搜索