怎么搭建github的maven仓库
其实原理倒是很简单,就是把artifactId deploy到本地,然后推到github上。
一步一步来干吧。
新建一个github repo,然后clone到本地。假如我们此次的地址是:
D:\git\maven-repository
然后再工程的pom中加deploy的设置:
<distributionManagement> <repository> <id>github-mvn-repo</id> <url>file:///D:/git/maven-repository/</url> </repository> </distributionManagement>
deploy一下,然后就看到有类似的层级目录了。
接着push到github上
之后只要在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仓库