1、maven仓库基础介绍
https://www.sojson.com/blog/168.html
2、基础搭建:通过docker搭建了基础仓库,只配置了<server>
https://blog.csdn.net/u012943767/article/details/79475718
3、其他设置
https://www.cnblogs.com/jingmoxukong/p/6050172.html
4、本人项目所使用仓库
(1)首先建立spring代理仓库:
通过官网找所需代理的库:https://repo.spring.io/webapp/#/home
生成如下xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>release</name>
<url>https://repo.spring.io/release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>snapshot</name>
<url>https://repo.spring.io/snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>https://repo.spring.io/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>https://repo.spring.io/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
然后再生成milestone与libs-milestone
xml如下:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>milestone</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-milestone</name>
<url>https://repo.spring.io/libs-milestone</url>
</repository>
</repositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
然后按照其名称与地址,对应的创建所需要的代理库。例如创建第一个库代理milestone,如下图,为了区分各类库,我为其取名为spring-milestone,如下图:
其他类似,建立相应的代理库。最终如下图所示:
最后新建一个Group类库,将所代理的类库全部包含进去,这样,客户端只要指定该Group类库,就可以下载相应的资源。
本人新建text_group库。如下图:
将左侧类库全部添加到右侧。
然后点击保存即可。这样客户端只要使用该test_group库即可。
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>test</id>
<name>test_gropu</name>
<url>http://172.168.1.17:8081/repository/text_group/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>