maven中setting.xml配置详解

详细可查看官方API文档 https://maven.apache.org/settings.html

https://maven.apache.org/guides/mini/guide-mirror-settings.html

<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
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
	<!-- 地存储库的路径。默认值为$ {user.home}/.m2/repository -->
	<localRepository>E:/work/maven-repository</localRepository>
	<!-- 是否使用交互模式,默认是true。如果设为false,那么当Maven需要用户进行输入的时候,它会使用一个默认值。 -->
	<!-- <interactiveMode>false</interactiveMode> -->
	<!-- 考虑Maven应使用$ {user.home}/.m2/plugin-registry.xml文件来管理插件版本,需要则设置为true,默认为false -->
	<!-- <usePluginRegistry>false</usePluginRegistry> -->
	<!-- 如果此构建系统需要在脱机模式下运行,则为true,默认为false。由于网络设置或安全原因,此元素对于无法连接到远程存储库的构建服务器很有用。 -->
	<!-- <offline>false</offline> -->
	<!-- 该元素包含一个pluginGroup元素列表 -->
	<!-- <pluginGroups/> -->
	<!-- 一系列的server子元素,表示当需要连接到一个远程服务器的时候需要使用到的验证方式,如: 
	<servers>
		<server>
			<id>id</id>
			<username>用户名</username>
			<password>密码</password>
		</server>
	</servers>
	-->
	<!-- <servers/> -->
	<!-- 配置mirrors远程镜像 -->
    <mirrors>
	    <mirror>
		    <id>alimaven</id>
		    <name>aliyun maven</name>
		    <url>http://maven.aliyun.com/mvn/view</url>
		    <mirrorOf>central</mirrorOf>
	    </mirror>
    </mirrors>
	<!-- 代理 -->
	<!-- <proxies /> -->
</settings>

 

我的配置:

<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
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
	<!-- 地存储库的路径。默认值为$ {user.home}/.m2/repository -->
	<localRepository>E:/work/maven-repository</localRepository>
	<!-- 配置mirrors远程镜像 -->
	<mirrors>
		<mirror>
			<id>apachemaven</id>
			<name>apache-maven</name>
			<url>http://repo.maven.apache.org/maven2/</url>
			<mirrorOf>central</mirrorOf>
		</mirror>

		<mirror>
			<id>nexus-aliyun</id>
			<name>Nexus aliyun</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
			<mirrorOf>*</mirrorOf>
		</mirror>
	</mirrors>
</settings>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值