首页 > 其他 > 详细

Maven Settings.xml 配置模板

时间:2020-12-28 18:11:13      阅读:139      评论:0      收藏:0      [点我收藏+]

Maven Settings.xml 配置模板

<?xml version="1.0" encoding="UTF-8"?>
<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>x:/xxx_repository</localRepository>
	<servers>
		<server>
			<id>xxx-releases</id>
			<username>xxx</username>
			<password>xxx</password>
		</server>
		<server>
			<id>xxx-snapshot</id>
			<username>xxx</username>
			<password>xxx</password>
		</server>
	</servers>
	<!-- 配置镜像 -->
	<mirrors>
		<mirror>
			<id>nexus</id>
			<!-- 表示该镜像匹配所有仓库,任何对于远程仓库的请求都会被转至 http://111.229.122.162:20008/nexus/content/groups/public/  -->
			<mirrorOf>*</mirrorOf>
			<url>http://xxx.xxx.xxx.xxx:xxx/nexus/content/groups/public/</url>
		</mirror>
	</mirrors>
	<!-- 使用 settings.xml 的 profile 机制配置(本机)全局仓库信息 -->
	<profiles>
		<profile>
			<id>nexus</id>
			<repositoryies>
				<repository>
					<!-- id都为central,也就是说,覆盖了超级POM中央仓库的配置 -->
					<id>central</id>
					<url>http://central</url>
					<releases>
						<enable>true</enable>
					</releases>
					<snapshots>
						<enable>true</enable>
					</snapshots>
				</repository>
			</repositoryies>
			<pluginRepositories>
				<pluginRepository>
					<id>central</id>
					<url>http://central</url>
					<releases>
						<enable>true</enable>
					</releases>
					<snapshots>
						<enable>true</enable>
					</snapshots>
				</pluginRepository>
			</pluginRepositories>
		</profile>
	</profiles>
	<activeProfiles>
		<activeProfile>nexus</activeProfile>
	</activeProfiles>
</settings>

注: x:按照自己实际配置的参数

Maven Settings.xml 配置模板

原文:https://www.cnblogs.com/simpleJokerKing/p/14202514.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!