今天把单点登陆的core模块搬到了github仓库 并且利用github仓库作为maven仓库 在项目中进行了引用

1. 起初看技术博客没有完全引入进来,调整了一下OK了

2. 还可以将其他模块或者工具类,常用的类,自己用的类发布到GitHub仓库 作为maven依赖

maven部署的插件,部署本地:

            <!--github上传插件,用于修改后的发布,执行mvn clean deploy自动打包上传到github-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<altDeploymentRepository>internal.repo::default::file://${repository.directory}/web-sso-core</altDeploymentRepository>
</configuration>
</plugin>

使用mvn clean deploy命令部署

部署到远端github仓库的插件:

        <plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>Maven artifacts for ${project.artifactId}-${project.version}</message>
<noJekyll>true</noJekyll>
<outputDirectory>${repository.directory}/web-sso-core</outputDirectory>
<branch>refs/heads/master</branch>
<merge>true</merge>
<includes>
<include>**/*</include>
</includes>
<repositoryName>web-sso-core</repositoryName>
<repositoryOwner>deadzq</repositoryOwner>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>

同样是使用mvn clean deploy.

配置文件,repository.directory是项目的根路径,在另一个地方指定模块的文件夹名: 如上面的插件的web-sso-core

    <properties>
<java.version>1.8</java.version>
<jedis.version>3.0.0</jedis.version>
<github.global.server>github</github.global.server>
<repository.directory>C:\Users\ukyo\Documents\</repository.directory>
</properties>

需要开放本地maven仓库的,设定用户名密码:

settings.xml:

server标签:

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

注意整个配置中的id应该相同.

另一边,在项目中去使用时,需要配置github仓库: 二级标签 (一级标签project)

    <repositories>
<repository>
<id>github</id>
<url>https://raw.github.com/deadzq/web-sso-core/master</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>

其中里面的url获取方式为,找到你发布好的github的模块,前面加二级域名raw. 后面加 /master ,假如你是发布到master分支的话.

最后加入这个模块即可:

        <dependency>
<groupId>com.sso</groupId>
<artifactId>web-sso-core</artifactId>
<version>1.0.0</version>
</dependency>

正常引入:

其他资料:

实测Maven上传jar包到私服的方法归纳

最新文章

  1. [Project Name] was compiled with optimization - stepping may behave oddly; variables may not be available.
  2. 格式化namenode,造成无法启动datanode
  3. UNIX/Linux打包,压缩 ,解压:
  4. Enum 绑定到 RadioButton
  5. MySQL约束
  6. ExecutorService(转)
  7. CentOS7安装Puppet+GitLab+Bind
  8. 深入浅出hive-hive简介
  9. CSS选择符详解之关系选择符篇
  10. UrlDownloadFile, 线程下载文件, 带进度条
  11. javascript每日一练(十二)——运动框架
  12. 为 ngui TweenPosition 添加 pingpongone
  13. python基础3--函数
  14. Kafka设计解析(七)- Kafka Stream
  15. Burp Scanner Report
  16. TensorFlow函数:tf.lin_space
  17. [Jedis] ERR wrong number of arguments for &#39;mget&#39;
  18. Blender的单位:一图弄懂Blender的单位
  19. oracle修改字符集方法
  20. OEM-ODM-OBM

热门文章

  1. python中 jsonchema 与 shema 效率比较
  2. 分布式系统根基:物理时钟和Lamport逻辑时钟
  3. 笔记:Java Language Specification - 章节17- 线程和锁
  4. Java自学-操作符 算数操作符
  5. ElasticSearch 中文分词搜索环境搭建
  6. 原生JS实现前端动画框架
  7. iOS - 屏幕刷新 ADisplayLink
  8. jsonserver的安装及启动
  9. Tomcat 8.5版本文件上传后无权限访问的问题
  10. shell:echo -e &quot;\033字体颜色&quot;