-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpom.xml
690 lines (655 loc) · 30.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
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
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
<?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>org.fortune</groupId>
<artifactId>fortune-commons</artifactId>
<version>1.0.4</version>
<packaging>pom</packaging>
<name>fortune-commons</name>
<description>整合各种常见的公共组件</description>
<modules>
<module>commons-datacache</module>
<module>commons-core</module>
<module>commons-nosql</module>
<module>commons-export</module>
<module>commons-web</module>
<module>commons-web-springmvc</module>
<module>fortune-commons-example</module>
<module>commons-doc-client-netty</module>
<module>commons-doc-server-netty</module>
<module>commons-doc-common</module>
<module>commons-doc-server-http</module>
<module>commons-doc-client-http</module>
<module>commons-crawler</module>
</modules>
<properties>
<!--system-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler>1.8</maven.compiler>
<!-- fortune commons组件版本 -->
<fortune.commons.core.version>${project.version}</fortune.commons.core.version>
<fortune.commons.datacache.version>${project.version}</fortune.commons.datacache.version>
<fortune.commons.nosql.version>${project.version}</fortune.commons.nosql.version>
<fortune.commons.export.version>${project.version}</fortune.commons.export.version>
<fortune.commons.web.version>${project.version}</fortune.commons.web.version>
<fortune.commons.web.springmvc.version>${project.version}</fortune.commons.web.springmvc.version>
<!-- 文件服务公共模块 -->
<fortune.commons.doc.common.version>${project.version}</fortune.commons.doc.common.version>
<!--Provided version-->
<servlet.api.version>3.1.0</servlet.api.version>
<commons.collections4.version>4.4</commons.collections4.version>
<commons.lang3.version>3.3.1</commons.lang3.version>
<commons.beanutils.version>1.9.2</commons.beanutils.version>
<commons.configuration2.version>2.4</commons.configuration2.version>
<commons.logging.version>1.2</commons.logging.version>
<commons.io.version>2.6</commons.io.version>
<commons.codec.version>1.13</commons.codec.version>
<!--Spring -->
<!--<spring.version>4.2.3.RELEASE</spring.version>-->
<spring.version>5.1.5.RELEASE</spring.version>
<aspectj.version>1.8.7</aspectj.version>
<!-- yaml -->
<yaml.version>1.18</yaml.version>
<!-- log4j -->
<slf4j.version>1.7.5</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<logback.version>1.2.3</logback.version>
<!--Jackson-->
<jackson.core.version>2.9.9</jackson.core.version>
<jackson.databind.version>2.9.9.2</jackson.databind.version>
<!--freemarker-->
<freemarker.version>2.3.28</freemarker.version>
<!--cglib-->
<cglib.version>3.2.10</cglib.version>
<!--test-->
<junit.version>4.12</junit.version>
<!--memCached 四种客户端版本,推荐:xmemcached-->
<!--https://www.cnblogs.com/EasonJim/p/7624822.html-->
<!--https://github.com/killme2008/xmemcached/wiki/Xmemcached%20%E4%B8%AD%E6%96%87%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97-->
<xmemcached.version>2.4.6</xmemcached.version>
<spymemcached.version>2.12.2</spymemcached.version>
<danga.memcached.version>2.6.6</danga.memcached.version>
<memcached.java.client.version>3.0.2</memcached.java.client.version>
<!-- jxls -->
<jxls.version>1.0.6</jxls.version>
<jxl.version>2.6.12</jxl.version>
<!-- excel org.apache.poi -->
<org.apache.poi.version>4.1.1</org.apache.poi.version>
<!-- itextpdf -->
<itextpdf.core.version>5.5.13</itextpdf.core.version>
<itextpdf.tool.version>5.5.13</itextpdf.tool.version>
<itextpdf.version>7.0.2</itextpdf.version>
<!--中文支持包-->
<itext-asian.version>5.2.0</itext-asian.version>
<!--<mongodb.version>2.9.3</mongodb.version>-->
<mongodb.version>3.10.1</mongodb.version>
<spring.data.mongo.version>2.1.5.RELEASE</spring.data.mongo.version>
<!--redis-->
<!--https://github.com/xetorthio/jedis-->
<jedis.version>3.0.1</jedis.version>
<commons.pool2.version>2.4.3</commons.pool2.version>
<spring.data.redis.version>2.1.5.RELEASE</spring.data.redis.version>
<!-- netty -->
<io.netty.version>3.6.3.Final</io.netty.version>
<fastjson.version>1.2.58</fastjson.version>
<thumbnailator.version>0.4.3</thumbnailator.version>
<javax.mail.version>1.4.7</javax.mail.version>
<apache-httpcomponents.version>4.5.5</apache-httpcomponents.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Own dependencies -->
<dependency>
<groupId>org.fortune</groupId>
<artifactId>commons-core</artifactId>
<version>${fortune.commons.core.version}</version>
</dependency>
<dependency>
<groupId>org.fortune</groupId>
<artifactId>commons-nosql</artifactId>
<version>${fortune.commons.nosql.version}</version>
</dependency>
<dependency>
<groupId>org.fortune</groupId>
<artifactId>commons-doc-common</artifactId>
<version>${fortune.commons.doc.common.version}</version>
</dependency>
<dependency>
<groupId>org.fortune</groupId>
<artifactId>commons-datacache</artifactId>
<version>${fortune.commons.datacache.version}</version>
</dependency>
<dependency>
<groupId>org.fortune</groupId>
<artifactId>commons-export</artifactId>
<version>${fortune.commons.export.version}</version>
</dependency>
<dependency>
<groupId>org.fortune</groupId>
<artifactId>commons-web</artifactId>
<version>${fortune.commons.web.version}</version>
</dependency>
<dependency>
<groupId>org.fortune</groupId>
<artifactId>commons-web-springmvc</artifactId>
<version>${fortune.commons.web.springmvc.version}</version>
</dependency>
<!--Spring 3.2以后 Spring Framework已经包含了cglib的jar包,可不必手动引入-->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>${cglib.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- freemarker start -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${freemarker.version}</version>
</dependency>
<!-- slf4j start -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- slf4j 实现之一:logback -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<!-- slf4j end -->
<!-- javax-servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.api.version}</version>
<scope>provided</scope>
</dependency>
<!-- Javax-mail -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>${javax.mail.version}</version>
</dependency>
<!-- apache commons -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons.collections4.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons.lang3.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!--<dependency>-->
<!--<groupId>commons-collections</groupId>-->
<!--<artifactId>commons-collections</artifactId>-->
<!--<version>3.2.1</version>-->
<!--</dependency>-->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons.beanutils.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>${commons.configuration2.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons.logging.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons.codec.version}</version>
</dependency>
<!--MemCache-->
<dependency>
<groupId>com.googlecode.xmemcached</groupId>
<artifactId>xmemcached</artifactId>
<version>${xmemcached.version}</version>
</dependency>
<dependency>
<groupId>net.spy</groupId>
<artifactId>spymemcached</artifactId>
<version>${spymemcached.version}</version>
</dependency>
<dependency>
<groupId>danga</groupId>
<artifactId>memCached</artifactId>
<version>${danga.memcached.version}</version>
</dependency>
<dependency>
<groupId>com.whalin</groupId>
<artifactId>Memcached-Java-Client</artifactId>
<version>${memcached.java.client.version}</version>
</dependency>
<!-- MemCache连接池依赖包-->
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<version>${io.netty.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- 生成缩略图工具 -->
<dependency>
<groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId>
<version>${thumbnailator.version}</version>
</dependency>
<!--web mvc 中HTTP JSON转换器-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.core.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.databind.version}</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<!-- aspectj -->
<!--Spring-aspects 实现类似 aspectj 注解方式的时候,借用了 aspectjweaver.jar 中定义的一些annotation 和 class,然而其并不使用 Aspectj 的字节码织入功能。-->
<!--Spring AOP使用JDK Proxy或者cglib实现代理类生成。对于有实现接口的类使用JDK Proxy,对于无接口的则是用cglib.通过-->
<!--<aop:aspectj-autoproxy proxy-target-class="true"/>-->
<!--指定proxy-target-class为true可强制使用cglib.-->
<!--aspectjtools.jar包主要是提供赫赫有名的ajc编译器,可以在编译期将将java文件或者class文件或者aspect文件定义的切面织入到业务代码中。
通常这个东西会被封装进各种IDE插件或者自动化插件中。
-->
<!-- aspectjrt.jar包主要是提供运行时的一些注解,静态方法等等东西,通常我们要使用aspectJ的时候都要使用这个包。 -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<!-- aspectjweaverjar包主要是提供了一个java agent用于在类加载期间织入切面(Load time weaving)。
并且提供了对切面语法的相关处理等基础方法,供ajc使用或者供第三方开发使用。这个包一般我们不需要显式引用,除非需要使用LTW。
-->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${yaml.version}</version>
</dependency>
<!-- excel 操作 模版操作相关 start -->
<!--http://jxls.sourceforge.net/-->
<!--2.x-->
<!--https://www.cnblogs.com/Crysta1/p/10250270.html-->
<!--http://www.cnblogs.com/jiangbei/p/7356712.html-->
<!--1.x-->
<!--https://blog.csdn.net/xiejx618/article/details/38906683-->
<dependency>
<groupId>net.sf.jxls</groupId>
<artifactId>jxls-core</artifactId>
<version>${jxls.version}</version>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>${jxl.version}</version>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- excel 操作相关 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${org.apache.poi.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<!-- excel 操作 end -->
<!-- PDF插件相关 start -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>${itextpdf.core.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>${itext-asian.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf.tool</groupId>
<artifactId>xmlworker</artifactId>
<version>${itextpdf.tool.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>kernel</artifactId>
<version>${itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>io</artifactId>
<version>${itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>layout</artifactId>
<version>${itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>forms</artifactId>
<version>${itextpdf.version}</version>
</dependency>
<!--设置pdf文件密码,还要引入下面bcprov-jdk15on.jar包:-->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.54</version>
</dependency>
<!-- PDF插件相关end -->
<!--mongodb驱动包:包括bson,mongo-java-drive和mongo-java-core-->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<version>${mongodb.version}</version>
</dependency>
<!--mongodb Spring核心包-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>${spring.data.mongo.version}</version>
<exclusions>
<exclusion>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--mongodb Spring依赖包-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>${spring.data.mongo.version}</version>
<scope>compile</scope>
</dependency>
<!--<dependency>-->
<!--<groupId>org.projectlombok</groupId>-->
<!--<artifactId>lombok</artifactId>-->
<!--<version>1.18.6</version>-->
<!--<scope>provided</scope>-->
<!--</dependency>-->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${apache-httpcomponents.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>${apache-httpcomponents.version}</version>
</dependency>
<!--redis-->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>${jedis.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>${commons.pool2.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>${spring.data.redis.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--SpringJUnit4ClassRunner requires JUnit 4.12 or higher.-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<!--spring单元测试依赖 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>fortune-commons</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!-- Maven版本管理插件 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
<!-- 一个好习惯,就是在此配置JDK的版本,这样就可以方便代码迁移 By Landy 2019.01.04-->
<!--一般而言,target与source是保持一致的。但是,有时候为了让程序能在其他版本的jdk中运行(对于低版本目标jdk,源代码中需要没有使用低版本jdk中不支持的语法),会存在target不同于source的情况 。-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${maven.compiler.source}</source> <!-- 源代码使用的开发版本 -->
<target>${maven.compiler.target}</target> <!-- 需要生成的目标class文件的编译版本 -->
<!-- 这下面的是可选项 -->
<meminitial>128m</meminitial>
<maxmem>512m</maxmem>
<fork>true</fork> <!-- fork is enable,用于明确表示编译版本配置的可用 -->
<encoding>${project.build.sourceEncoding}</encoding>
<compilerVersion>${maven.compiler}</compilerVersion>
<!-- 这个选项用来传递编译器自身不包含但是却支持的参数选项 -->
<compilerArguments>
<verbose/>
<bootclasspath>${env.JAVA_HOME}\jre\lib\rt.jar;${env.JAVA_HOME}\jre\lib\jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
<!--可以忽略web.xml的缺失检测-->
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<!--http://tomcat.apache.org/maven-plugin-2.2/ -->
<!--在Spring Boot中也有一个类似的插件:spring-boot-maven-plugin-->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>tomcat-run</id>
<goals>
<goal>exec-war-only</goal>
</goals>
<phase>package</phase>
<configuration>
<path>/${project.build.finalName}</path><!-- 相当于ServletContext的path路径 -->
</configuration>
</execution>
</executions>
</plugin>
<!-- 可以 使用 maven 生成 jar 的同时 生成 sources 包 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.0</version>
<!-- 绑定source插件到Maven的生命周期,并在生命周期后执行绑定的source的goal -->
<executions>
<execution>
<!-- 绑定source插件到Maven的生命周期 -->
<phase>compile</phase>
<!--在生命周期后执行绑定的source插件的goals -->
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>