Document

MAVEN的配置文件settings.xml还没看过?IDEA中的Maevn还是错的?

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>E:\本地仓库</localRepository>-->

<!-- 配置下载Jar包的镜像仓库地址:本地仓库中找不到的时候就回去配置的镜像里面去查找,有时候拉取镜像慢的原因是:没有配置国内的镜像;当然这边可以配置多种镜像 -->

<!-- 某些仓库是需要账号密码的,所以某些情况下还需要配置密码 -->
<mirrors>
  <mirror>
    <id>alimaven</id>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>
  </mirror>

  <mirror>
    <id>uk</id>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://uk.maven.org/maven2/</url>
    <mirrorOf>central</mirrorOf>
  </mirror>

  <mirror>
    <id>nexus</id>
    <name>internal nexus repository</name>
    <url>http://repo.maven.apache.org/maven2</url>
    <mirrorOf>central</mirrorOf>
  </mirror>
</mirrors>

<profiles>
<!-- 下载源代码和Javadoc -->
<profile>
<id>downloadSources</id>
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
</profile>
</profiles>

<!-- 激活在profiles的配置项 -->
<activeProfiles>
<activeProfile>downloadSources</activeProfile>
</activeProfiles>

</settings>

IDEA中的Maevn配置

结束啦

觉得有帮助的话可以关注下公众号哈,欢迎关注微信公众号<彭晓琪>


 

少年的志向,不应该是房子,他们应该伏案疾书,或为心中的梦想而挥洒汗水,畅想着自己未来光明的人生,少年的梦想,也不应该是生活,他们应该想要集齐七颗龙珠,或者幻想着拥有一颗皮卡丘。欢迎关注微信公众号<彭晓琪>

 

posted @ 2022-03-23 14:12  java请多指教  阅读(26)  评论(0编辑  收藏  举报