惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog
S
SegmentFault 最新的问题
博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏
U
Unit 42
GbyAI
GbyAI
B
Blog RSS Feed
博客园 - Franky
L
LangChain Blog
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
Last Week in AI
Last Week in AI
阮一峰的网络日志
阮一峰的网络日志
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research

CAYZLH

Reasonix 开箱:聊聊我装的那些 Skill 收藏一份自驾中国的愿望清单 白夜行·谢幕 英雄联盟的昨日今天与符文大乱斗 折腾的尽头是极简 一个 `data.` 引发的血案——Redis 连接 localhost 问题排查全记录 MacBook上备忘录APP的快捷键和手势 让Google屏蔽某些搜索结果 WSL自定义安装Ubuntu typora自动上传图片配置 自建giscus服务 Windows下结束指定端口的进程 批量修改maven多模块版本号 使用winsw部署SpringBoot项目 Gson简易指南 docker搭建Consul集群 使用Docker部署SpringBoot项目 Docker使用redis镜像 Docker使用rabbitmq Docker使用zookeeper Docker使用MySQL Dockerfile常用指令 Docker免sudo操作 雷鸟电视去广告 使用ADB卸载MIUI系统应用 利用GitHub做图床 将网站变成灰色 Github上传大文件 Android远程调试命令adb vscode快捷键的使用
利用Github做Maven私服
Ant丶 · 2022-09-10 · via CAYZLH

发布到GitHub

修改setting.xml

修改mavensetting.xml文件,在servers节点下添加

<server>
<id>github</id>
<username>yourname</username>
<password>yourpassword</password>
</server>

使用maven插件

修改项目工程的pom.xml文件,添加以下两个插件:

maven-deploy-plugin

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<altDeploymentRepository>
internal.repo::default::file://${project.build.directory}/maven-repo
</altDeploymentRepository>
</configuration>
</plugin>

site-maven-plugin

<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>🐳 deploy maven artifacts, version: ${project.version}</message>
<noJekyll>true</noJekyll>
<outputDirectory>${project.build.directory}/maven-repo</outputDirectory>

<branch>refs/heads/master</branch>
<merge>true</merge>
<includes>
<include>**/*</include>
</includes>
<repositoryName>maven-repo</repositoryName>
<repositoryOwner>cayzlh</repositoryOwner>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>

###deploy

执行命令进行打包:

mvn clean package

好像可以不用打包

idea左侧lifecycle中双击deploy

image-20200423221908456

静静等待…..

image-20200423222621366

使用

在需要使用到私服的项目pom.xml文件中添加:

<repositories>
<repository>
<id>maven-repo</id>
<url>https://raw.githubusercontent.com/yourname/maven-repo/master/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>