赞
踩
maven使用setting.xml配置文件配置仓库地址 - JavaShuo
<repositories>
<repository>
<id>alimaven</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/nexus/content/repositories/central/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>alimaven</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/nexus/content/repositories/central/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<?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>D:/maven repository/my_local_repository</localRepository>
<pluginGroups></pluginGroups>
<proxies></proxies>
<mirrors>
<!-- 镜像库 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>aliyun-repo</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>repo1</id>
<url>https://repo1.maven.org/maven2/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<!-- 注意:如下配置用于指定Maven插件的仓库,不能省略,不然可能出现没法加载Maven插件的问题 -->
<pluginRepositories>
<pluginRepository>
<id>aliyun-plugin</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
<pluginRepository>
<id>repo1-plugin</id>
<url>https://repo1.maven.org/maven2/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
--------------------------------------------------------------------------------------------------------------------
Maven的默认本地仓库在:${user.home}/.m2/repository;
如果需要自定义仓库路径,可以找到maven文件夹下的conf下的setting.xml文件进行修改,
以下自定义仓库路径为E:javaMavenapache-maven-3.3.9conf epository(repository为存放jar包的文件夹)
一般C:UsersAdmin.m2 epository文件夹下都是你maven项目用插件install之后打好的jar包,它既在你的项目的target下,又在你的这个本地仓库中。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。