Java的新项目学成在线笔记-day20(十)

.2.2 安装GitLab
GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务。 GitLab与GitHub的功能相似,通常企业使用GitLab在局域网搭建自己的Git代码管理仓库。
Java的新项目学成在线笔记-day20(十)
4.2.3 编写Pom.xml
本例子将xc-govern-center工程使用Jenkins进行构建。
在xc-govern-center工程根目录编写pom_docker_registry.xml 此文件相比工程原有pom.xml增加了docker-maven-plugin插件,其作用是构建docker镜像并将镜像推送到 Docker私有仓库(192.168.101.64:5000)。

[mw_shl_code=applescript,true] <?xml version="1.0" encoding="UTF‐8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema‐instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven‐4.0.0.xsd"&gt;
<parent>
<artifactId>xc‐framework‐parent</artifactId>
<groupId>com.xuecheng</groupId>
<version>1.0‐SNAPSHOT</version>
<relativePath>../xc‐framework‐parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xc‐govern‐center</artifactId>
<version>1.0‐SNAPSHOT</version>
<dependencies>
<!‐‐ 导入Eureka服务的依赖 ‐‐>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring‐cloud‐starter‐netflix‐eureka‐server</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}‐${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring‐boot‐maven‐plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker‐maven‐plugin</artifactId>
<version>1.0.0</version>
<!‐‐docker镜像相关的配置信息‐‐>
<configuration>
<!‐‐镜像名,这里用工程名‐‐>
<imageName>${project.artifactId}‐${project.version}</imageName>
<!‐‐Dockerfile文件所在目录‐‐>
<dockerDirectory>${project.basedir}/src/main/resources</dockerDirectory>
<!‐‐TAG,这里用工程版本号‐‐>
<imageTags>
<imageTag>${project.version}</imageTag>
</imageTags>
<registryUrl>192.168.101.64:5000</registryUrl>
<pushImage>true</pushImage>
<imageName>192.168.101.64:5000/${project.artifactId}:${project.version} </imageName>
<!‐‐构建镜像的配置信息‐‐>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.artifactId}‐${project.version}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build> </project>
[/mw_shl_code]

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值