docker搭建maven仓库

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>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值