原文链接:
POM文件配置Maven仓库地址 - JavaShuo
maven使用setting.xml配置文件配置仓库地址 - JavaShuo
在pom.xml文件中设置Maven本地存储库位置?
POM文件配置Maven仓库地址
<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>
maven使用setting.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>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包的文件夹)
文章来源:https://www.toymoban.com/news/detail-602277.html
一般C:UsersAdmin.m2 epository文件夹下都是你maven项目用插件install之后打好的jar包,它既在你的项目的target下,又在你的这个本地仓库中。文章来源地址https://www.toymoban.com/news/detail-602277.html
到了这里,关于POM文件配置Maven仓库地址的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!