怎么搭建github的maven仓库

怎么搭建github的maven仓库

其实原理倒是很简单,就是把artifactId deploy到本地,然后推到github上。

一步一步来干吧。

  1. 新建一个github repo,然后clone到本地。假如我们此次的地址是: D:\git\maven-repository

  2. 然后再工程的pom中加deploy的设置:

    <distributionManagement>
        <repository>
            <id>github-mvn-repo</id>
            <url>file:///D:/git/maven-repository/</url>
        </repository>
    </distributionManagement>
  3. deploy一下,然后就看到有类似的层级目录了。

  4. 接着push到github上

  5. 之后只要在pom.xml或者setting.xml中加入github仓库地址就可以使用了:

     <repositories>
        <repository>
            <id>sut-maven-repo</id>
            <url>https://raw.githubusercontent.com/Sutonline/maven-repository</url>
        </repository>
    </repositories>

参见的博文: 利用github搭建个人maven仓库

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值