forked from alibaba/easyexcel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpom.xml
More file actions
687 lines (637 loc) · 31 KB
/
Copy pathpom.xml
File metadata and controls
687 lines (637 loc) · 31 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
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
easyexcel-parent(fork 主 pom)
本 fork 由 io.github.easy4j 维护,基于 Alibaba EasyExcel 4.0.3 上游版本改造。
- 不修改 easyexcel-core 源码(commit hash 锁定的兼容性边界由版本号 5.0.0 表达)
- 新增 easyexcel-markdown 子模块
- 私有 Maven 仓库发布到阿里云 packages
本 pom 用 CI-friendly revision 注入版本号;flatten-maven-plugin 在
package 阶段把 \${revision} 占位替换为字面量写回 .flattened-pom.xml,
这是 5.0.0 release artifact 里 5 个子模块 pom 实际生效的版本号来源。
-->
<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>io.github.easy4j</groupId>
<artifactId>easyexcel-parent</artifactId>
<packaging>pom</packaging>
<version>${revision}</version>
<name>easyexcel-parent</name>
<description>easyexcel is a excel handle tools written in Java</description>
<url>https://github.com/easy-4-java/${project.artifactId}</url>
<inceptionYear>2018</inceptionYear>
<modules>
<module>easyexcel-core</module>
<module>easyexcel-support</module>
<module>easyexcel-markdown</module>
<module>easyexcel-test</module>
<module>easyexcel</module>
</modules>
<!--
════════════ properties ════════════
分四段:(1) 构建与版本;(2) easyexcel 自家模块;(3) 核心三方依赖;(4) 测试/Maven 插件版本。
升级版本时只动一处;新增依赖版本统一在 dependencyManagement 维护。
-->
<properties>
<!-- ─── (1) 构建与版本:CI-friendly revision 与编码/编译器/JVM 配置 ─── -->
<!-- CI-friendly 单一版本源:发布前只改此一处,5 个子模块同步升级 -->
<revision>5.0.2-SNAPSHOT</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.8</jdk.version>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<!-- ─── (2) easyexcel 自家模块(fork 内自给,避免发 Maven Central 后才能依赖) ─── -->
<!-- easyexcel-core / easyexcel-support / easyexcel-markdown 在 build 时按 reactor 顺序产出 -->
<!-- ─── (3) 核心三方依赖版本锁定(与 ddd4j-dependencies 同风格:
<artifactId>.version 属性 + 字母排序,dependencyManagement 统一引用;
现有版本均通过 JDK 8 兼容性验证,升级前须重跑全量回归) ─── -->
<assertj-core.version>3.27.3</assertj-core.version>
<commons-compress.version>1.27.1</commons-compress.version>
<commons-csv.version>1.14.1</commons-csv.version>
<commons-io.version>2.22.0</commons-io.version>
<ehcache.version>3.9.11</ehcache.version>
<fastjson2.version>2.0.64</fastjson2.version>
<junit-jupiter.version>5.14.4</junit-jupiter.version>
<lombok.version>1.18.46</lombok.version>
<logback-classic.version>1.5.18</logback-classic.version>
<poi.version>5.4.1</poi.version>
<poi-ooxml.version>${poi.version}</poi-ooxml.version>
<slf4j-api.version>1.7.36</slf4j-api.version>
<spring-boot.version>2.7.18</spring-boot.version>
<spring-core.version>5.3.37</spring-core.version>
<!-- ─── (4) 测试与构建插件开关 ─── -->
<!-- 默认跳过测试:私有仓库发布追求快;CI/回归请加 -Dmaven.test.skip=false -->
<maven.test.skip>true</maven.test.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<!-- 私有仓库发布不签 GPG;如未来发公共仓库请去掉此行并配置 gpg.keyname/secretKeyring -->
<gpg.skip>true</gpg.skip>
</properties>
<!--
════════════ 仓库声明(脱离默认 Maven Central) ════════════
fork 私有发布到阿里云 packages;repositories 段显式列出避免不同环境
settings.xml 镜像差异导致构建找错仓库。
-->
<repositories>
<repository>
<id>2624322-release-6F6h6R</id>
<name>Aliyun Maven Private Release</name>
<url>https://packages.aliyun.com/6927b116e6c3e0425dbdf60d/maven/2624322-release-6f6h6r</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>2624322-snapshot-3EoOv3</id>
<name>Aliyun Maven Private Snapshot</name>
<url>https://packages.aliyun.com/6927b116e6c3e0425dbdf60d/maven/2624322-snapshot-3eoov3</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>2624322-release-6F6h6R</id>
<url>https://packages.aliyun.com/6927b116e6c3e0425dbdf60d/maven/2624322-release-6f6h6r</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
<scm>
<url>https://github.com/easy-4-java/${project.artifactId}</url>
<connection>scm:git:https://git@github.com/easy-4-java/${project.artifactId}.git</connection>
</scm>
<!-- organization 保留 Alibaba Group(Apache-2.0 原作者署名要求) -->
<organization>
<name>Alibaba Group</name>
<url>https://github.com/alibaba</url>
</organization>
<developers>
<developer>
<id>jipengfei</id>
<name>jipengfei</name>
<email>1558143046@qq.com</email>
</developer>
<developer>
<id>zhuangjiaju</id>
<name>Jiaju Zhuang</name>
<email>zhuangjiaju@qq.com</email>
</developer>
</developers>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<!--
════════════ distributionManagement ════════════
mvn deploy 默认目的地。私仓 ID 与 settings.xml <server> id 一一对应。
mvn install 不会触发本配置(只装本地 ~/.m2/repository)。
-->
<distributionManagement>
<repository>
<id>2624322-release-6F6h6R</id>
<url>https://packages.aliyun.com/6927b116e6c3e0425dbdf60d/maven/2624322-release-6f6h6r</url>
</repository>
<snapshotRepository>
<id>2624322-snapshot-3EoOv3</id>
<url>https://packages.aliyun.com/6927b116e6c3e0425dbdf60d/maven/2624322-snapshot-3eoov3</url>
</snapshotRepository>
</distributionManagement>
<!--
════════════ dependencyManagement ════════════
本 fork reactor 自给(所有 easyexcel-* 子模块都在本 fork 内产出),
第三方依赖版本集中在这一段维护。
-->
<dependencyManagement>
<dependencies>
<!-- ===== 本 fork 自家模块(坐标 io.github.easy4j:easyexcel-*) ===== -->
<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>easyexcel</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>easyexcel-core</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>io.github.easy4j</groupId>
<artifactId>easyexcel-support</artifactId>
<version>${revision}</version>
</dependency>
<!-- ===== POI 套件 ===== -->
<!-- poi-ooxml 5.4.1 修复 CVE-2025-31672(重复 ZIP entry 操纵解析) -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi-ooxml.version}</version>
</dependency>
<!-- ===== Apache Commons 套件 ===== -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>${commons-csv.version}</version>
</dependency>
<!-- commons-compress 1.27.1 修复 CVE-2024-26308 / CVE-2024-25710;
显式锁定防止依赖解析回退到受漏洞影响版本 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>${commons-compress.version}</version>
</dependency>
<!-- ===== 缓存与 IO 工具 ===== -->
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>${ehcache.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<!-- ===== 日志与注解处理 ===== -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- ===== Spring(support 的 shade 源 + test 的集成测试环境) ===== -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring-core.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback-classic.version}</version>
</dependency>
<!-- ===== JSON(仅 easyexcel-test 使用) ===== -->
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson2.version}</version>
</dependency>
<!-- ===== 测试框架(fork 内统一 JUnit5 + AssertJ) ===== -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!--
════════════ dependencies(所有子模块默认继承) ════════════
- slf4j-api 全模块共享
- lombok provided:编译期生成 getter/setter,不进入发布 jar
-->
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<!--
════════════ pluginManagement(插件版本与共享配置) ════════════
子模块按需启用;版本与插件仓库在此集中维护。
-->
<pluginManagement>
<plugins>
<!-- Maven PMD + 阿里 P3C 规约扫描:拦截魔法值、HashMap 无容量等违例 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.8</version>
<dependencies>
<dependency>
<groupId>com.alibaba.p3c</groupId>
<artifactId>p3c-pmd</artifactId>
<version>1.3.6</version>
</dependency>
</dependencies>
</plugin>
<!-- Maven Compiler:JDK 1.8 source/target,保留 lombok 注解处理 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<!-- Maven Source Plugin:发布源码 jar,方便下游阅读 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
</plugin>
<!-- GPG:默认跳过;切公共仓库时去掉根 properties 的 gpg.skip=true -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
</plugin>
<!-- Javadoc:默认跳过(中文注释与 doclint 容易冲突) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- lombok-maven-plugin:delombok 把 @Data 还原为普通 getter/setter 再编译,
避免 javac 注解处理器版本不匹配导致 200+ 找不到符号错误(2026-08 教训) -->
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.20.0</version>
</plugin>
<!-- Maven Surefire:跑单元测试;默认 skip=true,需要时 -Dmaven.test.skip=false -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<!-- Maven Shade Plugin:easyexcel-support 用它把 spring-core 重打包为
com.alibaba.excel.support 命名空间,避免下游 Spring 版本冲突 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<!-- Flatten Maven Plugin:把 \${revision} 占位写回为字面量,
5.0.0 发布 artifact 里子模块 pom 实际生效的版本号由本插件注入 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.2.7</version>
</plugin>
<!-- Maven Enforcer:门禁插件,强制 Maven 与 JDK 版本,防止跨环境构建漂移 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.3.0</version>
</plugin>
</plugins>
</pluginManagement>
<!--
════════════ plugins(本 pom 即生效,子模块自动继承) ════════════
选型原则:lifecycle 关键插件 + 上游 easyexcel 强制要求的 P3C 扫描。
-->
<plugins>
<!-- P3C 代码规约:validate 阶段运行,覆盖率大于 0 即失败 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<printFailingErrors>true</printFailingErrors>
<verbose>true</verbose>
<rulesets>
<ruleset>rulesets/java/ali-comment.xml</ruleset>
<ruleset>rulesets/java/ali-concurrent.xml</ruleset>
<ruleset>rulesets/java/ali-constant.xml</ruleset>
<ruleset>rulesets/java/ali-exception.xml</ruleset>
<ruleset>rulesets/java/ali-flowcontrol.xml</ruleset>
<ruleset>rulesets/java/ali-naming.xml</ruleset>
<ruleset>rulesets/java/ali-oop.xml</ruleset>
<ruleset>rulesets/java/ali-orm.xml</ruleset>
<ruleset>rulesets/java/ali-other.xml</ruleset>
<ruleset>rulesets/java/ali-set.xml</ruleset>
</rulesets>
<excludes>
<exclude>com/alibaba/excel/event/AnalysisEventListener.java</exclude>
<exclude>com/alibaba/excel/metadata/DataFormatter.java</exclude>
<exclude>com/alibaba/excel/util/DateUtils.java</exclude>
<exclude>com/alibaba/excel/util/MapUtils.java</exclude>
<exclude>com/alibaba/excel/util/EasyExcelTempFileCreationStrategy.java</exclude>
<exclude>com/alibaba/excel/metadata/format/DataFormatter.java</exclude>
<exclude>com/alibaba/excel/metadata/format/ExcelGeneralNumberFormat.java</exclude>
<exclude>com/alibaba/excel/metadata/csv/CsvDataFormat.java</exclude>
<exclude>com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java</exclude>
<exclude>com/alibaba/excel/analysis/v07/handlers/sax/SharedStringsTableHandler.java</exclude>
<exclude>com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>pmd-check-verify</id>
<phase>validate</phase>
<goals><goal>check</goal></goals>
</execution>
</executions>
</plugin>
<!-- Compiler:1.8 字节码(lombok-maven-plugin delombok 后由 javac 编译) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<!-- Source jar:发布源码供下游阅读 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals><goal>jar</goal></goals>
</execution>
</executions>
</plugin>
<!-- GPG:默认跳过(gpg.skip=true);保留执行声明以便未来切换公共仓库时立即生效 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<phase>verify</phase>
<goals><goal>sign</goal></goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<argument>--pinentry-mode</argument>
<argument>loopback</argument>
</gpgArguments>
</configuration>
</plugin>
<!-- Javadoc:默认跳过(maven.javadoc.skip=true) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals><goal>jar</goal></goals>
</execution>
</executions>
</plugin>
<!-- lombok delombok:见 pluginManagement 说明 -->
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals><goal>delombok</goal></goals>
</execution>
</executions>
</plugin>
<!-- Flatten:见 pluginManagement 说明 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>oss</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten.process-resources</id>
<phase>process-resources</phase>
<goals><goal>flatten</goal></goals>
</execution>
<execution>
<id>flatten</id>
<phase>package</phase>
<goals><goal>flatten</goal></goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals><goal>clean</goal></goals>
</execution>
</executions>
</plugin>
<!--
Enforcer:锁死 Maven 与 JDK 版本下限。
历史教训:2026-08 本机 Homebrew Maven 默认 JDK 跳到 26 导致 lombok
注解处理失败、200+ 找不到符号错误。requireJavaVersion 强制 ≥1.8 且
≤当前 release,requireMavenVersion 强制 ≥3.6(flatten 与 CI 友好
revision 需要)。
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-maven-and-jdk</id>
<phase>validate</phase>
<goals><goal>enforce</goal></goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.6.0,)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[1.8,21]</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!--
nexus-staging 已禁用。私有仓库走 maven-deploy-plugin 默认上传即可;
公共仓库(Sonatype OSSRH / Central Portal)发布需要时取消注释。
-->
</plugins>
</build>
<!--
════════════ profiles ════════════
central:发布到 Sonatype Central Portal(公共 Maven 中央仓库)。
激活方式:mvn deploy -Pcentral
前置条件(用户需在 https://central.sonatype.com 完成一次):
1. 登录并验证 groupId io.github.easy4j 命名空间所有权
2. settings.xml 配置 <server><id>central</id><username>…</username><password>…</password></server>
3. 本机可用 GPG key(发布前 gpg -list-keys 确认)
发布说明:
- Central 校验要求 sources.jar + javadoc.jar + GPG 签名,本 profile 全部启用
- maven-deploy-plugin skip=true:避免 deploy 落到 distributionManagement(阿里云私仓)
- central-publishing-maven-plugin 负责上传到 Central Portal
-->
<profiles>
<profile>
<id>central</id>
<properties>
<!-- 覆盖根 pom 默认跳过项:Central 要求 javadoc jar + GPG 签名 -->
<maven.javadoc.skip>false</maven.javadoc.skip>
<gpg.skip>false</gpg.skip>
</properties>
<build>
<plugins>
<!-- Central Portal 校验要求发布 sources jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<!-- Central Portal 校验要求发布 javadoc jar;-Xdoclint:none 兼容存量中文注释 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.12.0</version>
<configuration>
<additionalJOption>-Xdoclint:none</additionalJOption>
</configuration>
<executions>
<execution>
<id>attach-javadocs-central</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Central Portal 要求所有构件 GPG 签名 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<argument>--pinentry-mode</argument>
<argument>loopback</argument>
</gpgArguments>
</configuration>
</plugin>
<!-- 禁用 maven-deploy-plugin:deploy 阶段交给 central-publishing-maven-plugin,
避免构件落到 distributionManagement(阿里云私仓) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- Sonatype Central Portal 发布插件(https://central.sonatype.com/publish/publish-portal-maven/) -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.11.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
<excludeArtifacts>
<excludeArtifact>*-consumer.pom*</excludeArtifact>
</excludeArtifacts>
</configuration>
<executions>
<execution>
<id>publish-to-central</id>
<phase>deploy</phase>
<goals>
<goal>publish</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>