maven 安装目录里面settings配置意义和单项说明
一 localRepository
配置本地仓库:意思说maven打包什么的首先放到本地仓库里面去 以后寻找也会首先从本地仓库里面找!
D:/install/apache-maven-3.8.2/maven_repository
二、镜像地址
marrorof 特别重要 代表要代理仓库类型
我们会从mirros 第一个代理地址寻找 会首次从aliyun maven中找
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
私服地址配置生效原则
首先位置很重要 第一个是我们私服地址 如果只配置次选项
如果我们删掉本地仓库后只配置私服镜像
如果说service依赖dao 现在我们把本地仓库里面的dao删除
然后执行service install
我们发现会从阿里云上找
发现找不到
<mirrors>
<mirror>
<id>public</id>
<mirrorOf>*</mirrorOf>
<name>Public Repositories</name>
<url>http://192.168.0.24:8081/nexus/content/groups/public/</url>
</mirror>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
</mirrors>
三、私服地址生效处理需要配置第一镜像之外,还需要方式一全局配置---->maven安装目录 conf–>setting里面
<profiles>
<profile>
<id>dev</id>
<repositories>
<repository>
<id>Public Repositories</id>
<url>http://192.168.0.24:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>Public Repositories</id>
<url>http://192.168.0.24:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
四、私服地址生效处理需要配置第一镜像之外,还需要方式二局部配置(和三说明二选一)---->modle目录pom中配置
project目录下即可
public333 Public Repositories333 http://192.168.0.24:8081/nexus/content/groups/public/ public Public Repositories http://192.168.0.24:8081/nexus/content/groups/public/