Java怎么搭建自己的仓库_利用github搭建个人maven仓库的方法步骤

缘起

之前看到有开源项目用了github来做maven仓库,寻思自己也做一个。研究了下,记录下。

简单来说,共有三步:

deploy到本地目录

把本地目录提交到gtihub上

配置github地址为仓库地址

配置local file maven仓库

deploy到本地

maven可以通过http, ftp, ssh等deploy到远程服务器,也可以deploy到本地文件系统里。

例如把项目deploy到/home/hengyunabc/code/maven-repo/repository/目录下:

hengyunabc-mvn-repo

file:/home/hengyunabc/code/maven-repo/repository/

通过命令行则是:

mvn deploy -DaltDeploymentRepository=hengyunabc-mvn-repo::default::file:/home/hengyunabc/code/maven-repo/repository/

推荐使用命令行来deploy,避免在项目里显式配置。

把本地仓库提交到github上

上面把项目deploy到本地目录home/hengyunabc/code/maven-repo/repository里,下面把这个目录提交到github上。

在Github上新建一个项目,然后把home/hengyunabc/code/maven-repo下的文件都提交到gtihub上。

cd /home/hengyunabc/code/maven-repo/

git init

git add repository/*

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值