-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpom.xml
More file actions
458 lines (439 loc) · 20.1 KB
/
pom.xml
File metadata and controls
458 lines (439 loc) · 20.1 KB
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
<?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.wk</groupId>
<artifactId>framework</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
<modules>
<module>oauth2-server</module>
<!-- <module>eureka-server</module>-->
<!-- <module>config-server</module>-->
<module>admin-server</module>
<module>zuul-server</module>
<module>dataway</module>
<!-- <module>commons</module>-->
<module>learning</module>
<module>gateway-server</module>
<module>flink</module>
<module>oauth-server</module>
<module>file-management</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.SR8</spring-cloud.version>
<spring-boot.version>2.3.2.RELEASE</spring-boot.version>
<spring.cloud.alibaba.version>2.2.5.RELEASE</spring.cloud.alibaba.version>
<dockerNexusServer>wk-server</dockerNexusServer>
<dockerNexusServerPort>18082</dockerNexusServerPort>
<kotlin.version>1.4.30-RC</kotlin.version>
<jib.skip>true</jib.skip>
<mainClass>com.wk.@project.artifactId@.Application</mainClass>
<fastjson.version>1.2.68</fastjson.version>
<nacos.version>2.1.3.RELEASE</nacos.version>
<lombok.version>1.18.12</lombok.version>
<mybatis-plus.version>3.4.3.4</mybatis-plus.version>
<swagger.version>1.5.24</swagger.version>
<spring-boot-maven-plugin.version>2.1.8.RELEASE</spring-boot-maven-plugin.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<versions-maven-plugin.version>2.7</versions-maven-plugin.version>
<maven-release-plugin.version>3.0.0-M1</maven-release-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring.cloud.alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.8.RELEASE</version>
<configuration>
<layout>ZIP</layout>
<attach>false</attach>
<mainClass>${mainClass}</mainClass>
</configuration>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>build-info</goal>
</goals>
</execution>
<execution>
<id>package</id>
<phase>package</phase>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension></nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>deploy</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<allowReleasePluginSnapshot>true</allowReleasePluginSnapshot>
<useReleaseProfile>true</useReleaseProfile>
<tagNameFormat>@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.8.RELEASE</version>
<configuration>
<layout>ZIP</layout>
<attach>false</attach>
<mainClass>${mainClass}</mainClass>
</configuration>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>build-info</goal>
</goals>
</execution>
<execution>
<id>package</id>
<phase>package</phase>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>1.8</jvmTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<!--配置文件的位置-->
<configurationFile>src/main/resources/mybatis-generator-config.xml</configurationFile>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.27</version>
</dependency>
<!--生成代码插件-->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
<configuration>
<skipDockerBuild>${docker.skipDockerBuild}</skipDockerBuild>
<skipDockerPush>${docker.skipDockerPush}</skipDockerPush>
<imageName>${dockerNexusServer}:${dockerNexusServerPort}/${project.artifactId}:${project.version}</imageName>
<imageTags>
<imageTag>${project.version}</imageTag>
</imageTags>
<registryUrl>http://${dockerNexusServer}:${dockerNexusServerPort}</registryUrl>
</configuration>
</execution>
</executions>
<configuration>
<baseImage>${dockerNexusServer}:${dockerNexusServerPort}/jre:8</baseImage>
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
<env>
</env>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<forceTags>true</forceTags>
<serverId>central</serverId>
</configuration>
</plugin>
<!--
mvn compile jib:buildTar
将镜像生成tar文件,保存在项目的target目录下
在任何docker环境执行 docker load \-\-input xxx.tar即可导入到本地镜像仓库
mvn compile jib:dockerBuild
将镜像存入当前镜像仓库,该仓库是当前docker客户端可以连接的docker daemon,一般是指本地镜像仓库
mvn compile jib:build
将镜像推送到远程仓库,仓库位置与镜像名字的前缀有关,一般是hub.docker.com或者阿里云镜像仓库,使用该参数时需要提前登录成功
-->
<!-- 使用jib插件直接将应用打包为一个Docker镜像 mvn compile jib:dockerBuild -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.6.0</version>
<configuration>
<!-- 由于直接mvn install会报错,需要传入参数-DsendCredentialsOverHttp=true -->
<skip>${jib.skip}</skip>
<from>
<!-- 基于自定义的jre镜像 -->
<image>${dockerNexusServer}:${dockerNexusServerPort}/jre:8</image>
</from>
<to>
<image>${dockerNexusServer}:${dockerNexusServerPort}/${project.artifactId}:${project.version}</image>
<tags>
<tag>${project.version}</tag>
</tags>
</to>
<!--container节点用来设置容器的属性,例如对外暴露的端口、jvm参数等-->
<container>
<!--jvm启动参数-->
<jvmFlags>
<jvmFlag>-Djava.awt.headless=true</jvmFlag>
<jvmFlag>-Duser.timezone=GMT+08</jvmFlag> <!-- 设置时区 -->
</jvmFlags>
<!--要暴露的端口-->
<ports>
<port>3004</port>
</ports>
<!--使用该参数将镜像的创建时间与系统时间一致-->
<!--<useCurrentTimestamp>true</useCurrentTimestamp>-->
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
<mainClass>${mainClass}</mainClass>
<!-- 设置时区 -->
<environment>
<TZ>Asia/Shanghai</TZ>
</environment>
</container>
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
<!-- 把 jib 绑定到 Maven 命令中-->
<executions>
<execution>
<phase>install</phase><!-- 表示执行mvn install命令的时候就会自动构建镜像了-->
<goals>
<goal>build</goal><!-- 表示执行的jib命令-->
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>com.wk</groupId>-->
<!-- <artifactId>dockercompose-maven-plugin</artifactId>-->
<!-- <version>1.0.0-SNAPSHOT</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>generate</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <applicationGroup>framework</applicationGroup>-->
<!-- <dockerNexusServer>${dockerNexusServer}</dockerNexusServer>-->
<!-- <dockerNexusServerPort>${dockerNexusServerPort}</dockerNexusServerPort>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>public</id>
<name>public</name>
<url>http://wk-server:1000/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<id>central</id>
<name>central</name>
<url>http://wk-server:1000/repository/maven-public/</url>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>releases</id>
<name>releases</name>
<url>http://wk-server:1000/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>snapshots</name>
<url>http://wk-server:1000/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<!--不同环境Profile的唯一id-->
<id>dev</id>
<properties>
<docker.skipDockerBuild>true</docker.skipDockerBuild>
<docker.skipDockerPush>true</docker.skipDockerPush>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>test</id>
<properties>
<docker.skipDockerBuild>false</docker.skipDockerBuild>
<docker.skipDockerPush>false</docker.skipDockerPush>
</properties>
</profile>
</profiles>
</project>