feat(新增): 项目打包
This commit is contained in:
parent
1b8d37ef30
commit
3f9239aa57
|
@ -11,7 +11,7 @@
|
|||
<packaging>jar</packaging>
|
||||
|
||||
<name>sky-pojo</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<url>https://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM openjdk:18
|
||||
FROM openjdk:17
|
||||
|
||||
#系统编码
|
||||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
||||
|
|
|
@ -13,9 +13,21 @@
|
|||
<artifactId>sky-server</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<docker.repostory>192.168.1.4:1100</docker.repostory>
|
||||
<docker.registry.name>sky</docker.registry.name>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sky</groupId>
|
||||
<artifactId>sky-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sky</groupId>
|
||||
<artifactId>sky-pojo</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
|
@ -118,16 +130,52 @@
|
|||
<artifactId>junit</artifactId>
|
||||
<version>4.13.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sky</groupId>
|
||||
<artifactId>sky-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sky</groupId>
|
||||
<artifactId>sky-pojo</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>1.2.2</version>
|
||||
<!--将插件绑定在某个phase执行-->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-image</id>
|
||||
<!--将插件绑定在package这个phase(阶段)上。也就是说,用户只需执行mvn package,就会自动执行mvn docker:build-->
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
<goal>push</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<serverId>harbor</serverId>
|
||||
<registryUrl>http://${docker.repostory}</registryUrl>
|
||||
<!-- 配置docker主机地址 -->
|
||||
<dockerHost>http://192.168.1.4:2375</dockerHost>
|
||||
<!--指定生成的镜像名-->
|
||||
<imageName>
|
||||
${docker.repostory}/${docker.registry.name}/${project.artifactId}:${project.version}
|
||||
</imageName>
|
||||
<!-- 指定 dockerfile 路径-->
|
||||
<dockerDirectory>${project.basedir}</dockerDirectory>
|
||||
<!-- 是否跳过docker构建 -->
|
||||
<skipDockerBuild>false</skipDockerBuild>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
Loading…
Reference in New Issue