-
Notifications
You must be signed in to change notification settings - Fork 3
/
pom.xml
235 lines (227 loc) · 10.1 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gitegg.boot</groupId>
<artifactId>gitegg-boot</artifactId>
<version>1.0.7.RELEASE</version>
<packaging>pom</packaging>
<modules>
<module>gitegg-application</module>
<module>gitegg-service</module>
<module>gitegg-generator</module>
<module>gitegg-schedule</module>
<module>gitegg-monitor</module>
</modules>
<properties>
<start-class>com.gitegg.boot.GitEggBootApplication</start-class>
<!-- jdk版本1.8 -->
<java.version>1.8</java.version>
<!-- maven-compiler-plugin插件版本,Java代码编译 -->
<maven.plugin.version>3.8.1</maven.plugin.version>
<!-- maven编译时指定编码UTF-8 -->
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<!-- jib-maven-plugin插件版本,代码打包docker -->
<jib.maven.plugin.version>3.1.4</jib.maven.plugin.version>
<!-- 项目统一字符集编码UTF-8 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- 项目统一字符集编码UTF-8 -->
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- GitEgg项目统一设置版本号 -->
<gitegg.project.version>1.0.7.RELEASE</gitegg.project.version>
<!-- SpringBoot版本号 -->
<spring.boot.version>2.3.12.RELEASE</spring.boot.version>
</properties>
<dependencies>
<!-- Lombok 通过简单注解消除冗长代码 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- hutool Java常用工具包-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
<!-- spring-boot-admin监控 客户端 -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<!-- 去除springboot默认的logback配置-->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<!-- gitegg-platform相关Jar包 -->
<dependency>
<groupId>com.gitegg.platform</groupId>
<artifactId>gitegg-platform-bom</artifactId>
<version>${gitegg.project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>${project.name}</finalName>
<resources>
<!-- 增加分环境读取配置 -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/*.jks</exclude>
<exclude>static/**</exclude>
</excludes>
</resource>
<!-- 解决jks被过滤掉的问题 -->
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.jks</include>
<include>static/**</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<pluginManagement>
<plugins>
<!-- 用于在编译(compile)阶段加入定制化参数,比如设置项目源码的jdk版本、编译的jdk版本,以及项目编码等 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${maven.compiler.encoding}</encoding>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<!-- 能够将Spring Boot应用打包为可执行的jar或war文件,然后以通常的方式运行Spring Boot应用 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<fork>true</fork>
<finalName>${project.build.finalName}</finalName>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Docker 打包插件 -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib.maven.plugin.version}</version>
<!-- 绑定到Maven的install生命周期 ,此处如果不使用https,会有问题,需要设置sendCredentialsOverHttp=true-->
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<!--允许非https-->
<allowInsecureRegistries>true</allowInsecureRegistries>
<!-- 相当于Docerkfile中的FROM -->
<from>
<image>openjdk:8-jdk-alpine</image>
</from>
<to>
<image>${docker.harbor.addr}/${docker.harbor.project}/${project.artifactId}:${project.version}</image>
<auth>
<username>${docker.harbor.username}</username>
<password>${docker.harbor.password}</password>
</auth>
</to>
<container>
<!--jvm内存参数-->
<jvmFlags>
<jvmFlag>-Xms512m</jvmFlag>
<jvmFlag>-Xmx4g</jvmFlag>
</jvmFlags>
<volumes>/giteggData</volumes>
<workingDirectory>/gitegg</workingDirectory>
<environment>
<TZ>Asia/Shanghai</TZ>
</environment>
<!--使用该参数保证镜像的创建时间与系统时间一致-->
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
<format>OCI</format>
</container>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<activation>
<!--默认为dev环境打包方式-->
<activeByDefault>true</activeByDefault>
</activation>
<id>dev</id>
<properties>
<spring.profiles.active>dev</spring.profiles.active>
<docker.harbor.addr>172.16.20.175</docker.harbor.addr>
<docker.harbor.project>gitegg</docker.harbor.project>
<docker.harbor.username>robot$gitegg</docker.harbor.username>
<docker.harbor.password>Jqazyv7vvZiL6TXuNcv7TrZeRdL8U9n3</docker.harbor.password>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<spring.profiles.active>test</spring.profiles.active>
<docker.harbor.addr>172.16.20.175</docker.harbor.addr>
<docker.harbor.project>gitegg</docker.harbor.project>
<docker.harbor.username>robot$gitegg</docker.harbor.username>
<docker.harbor.password>Jqazyv7vvZiL6TXuNcv7TrZeRdL8U9n3</docker.harbor.password>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<spring.profiles.active>prod</spring.profiles.active>
<docker.harbor.addr>172.16.20.175</docker.harbor.addr>
<docker.harbor.project>gitegg</docker.harbor.project>
<docker.harbor.username>robot$gitegg</docker.harbor.username>
<docker.harbor.password>Jqazyv7vvZiL6TXuNcv7TrZeRdL8U9n3</docker.harbor.password>
</properties>
</profile>
</profiles>
</project>