|
8 | 8 | <description>OpenCode Java SDK - JDK 21 line</description> |
9 | 9 | <version>3.0.x.20260630-SNAPSHOT</version> |
10 | 10 | <packaging>jar</packaging> |
| 11 | + |
| 12 | + <!-- 开源协议采用 Apache 2.0 协议 --> |
11 | 13 | <licenses> |
12 | 14 | <license> |
13 | 15 | <name>The Apache Software License, Version 2.0</name> |
14 | 16 | <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> |
15 | 17 | </license> |
16 | 18 | </licenses> |
| 19 | + |
| 20 | + <!-- 源码仓库(SCM)信息 --> |
17 | 21 | <scm> |
18 | 22 | <connection>scm:git:https://github.com/easy-4-java/${project.artifactId}.git</connection> |
19 | 23 | <developerConnection>scm:git:https://github.com/easy-4-java/${project.artifactId}.git</developerConnection> |
20 | 24 | <url>https://github.com/easy-4-java/${project.artifactId}</url> |
21 | 25 | <tag>${project.artifactId}</tag> |
22 | 26 | </scm> |
| 27 | + |
| 28 | + <!-- 开发者信息 --> |
23 | 29 | <developers> |
24 | 30 | <developer> |
25 | 31 | <name>Loong Wan</name> |
|
31 | 37 | <timezone>+8</timezone> |
32 | 38 | </developer> |
33 | 39 | </developers> |
| 40 | + |
| 41 | + <!-- 制品发布仓库配置(distributionManagement) --> |
34 | 42 | <distributionManagement> |
35 | 43 | <repository> |
36 | 44 | <id>2624322-release-6F6h6R</id> |
|
41 | 49 | <url>https://packages.aliyun.com/6927b116e6c3e0425dbdf60d/maven/2624322-snapshot-3eoov3</url> |
42 | 50 | </snapshotRepository> |
43 | 51 | </distributionManagement> |
| 52 | + |
| 53 | + <!-- 版本属性定义:Java 版本、依赖版本与 Maven 插件版本统一管理 --> |
44 | 54 | <properties> |
45 | | - <central-publishing-maven-plugin.version>0.11.0</central-publishing-maven-plugin.version> |
| 55 | + <maven-central-publishing-plugin.version>0.11.0</maven-central-publishing-plugin.version> |
46 | 56 | <java.version>21</java.version> |
47 | 57 | <maven.compiler.release>${java.version}</maven.compiler.release> |
48 | 58 | <maven.compiler.source>${java.version}</maven.compiler.source> |
|
69 | 79 | <maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version> |
70 | 80 | <maven-source-plugin.version>3.4.0</maven-source-plugin.version> |
71 | 81 | <maven-central-publishing-plugin.version>0.11.0</maven-central-publishing-plugin.version> |
72 | | - <jacoco-maven-plugin.version>0.8.15</jacoco-maven-plugin.version> |
| 82 | + <maven-jacoco-plugin.version>0.8.15</maven-jacoco-plugin.version> |
73 | 83 | </properties> |
| 84 | + |
| 85 | + <!-- 依赖版本统一管理(dependencyManagement) --> |
74 | 86 | <dependencyManagement> |
| 87 | + |
| 88 | + <!-- 项目依赖(dependencies) --> |
75 | 89 | <dependencies> |
76 | 90 | <dependency> |
77 | 91 | <groupId>com.fasterxml.jackson</groupId> |
|
126 | 140 | </dependency> |
127 | 141 | </dependencies> |
128 | 142 | </dependencyManagement> |
| 143 | + |
| 144 | + <!-- 项目依赖(dependencies) --> |
129 | 145 | <dependencies> |
130 | 146 | <dependency> |
131 | 147 | <groupId>com.squareup.okhttp3</groupId> |
|
163 | 179 | <scope>test</scope> |
164 | 180 | </dependency> |
165 | 181 | </dependencies> |
| 182 | + |
| 183 | + <!-- 构建配置(Build) --> |
166 | 184 | <build> |
| 185 | + |
| 186 | + <!-- 插件版本统一管理(pluginManagement) --> |
167 | 187 | <pluginManagement> |
168 | 188 | <plugins> |
169 | 189 | <plugin> |
170 | 190 | <groupId>org.apache.maven.plugins</groupId> |
171 | 191 | <artifactId>maven-clean-plugin</artifactId> |
172 | 192 | <version>${maven-clean-plugin.version}</version> |
173 | 193 | </plugin> |
| 194 | + |
| 195 | + <!-- Maven 编译插件:统一 Java 版本参数与 Lombok 注解处理 --> |
174 | 196 | <plugin> |
175 | 197 | <groupId>org.apache.maven.plugins</groupId> |
176 | 198 | <artifactId>maven-compiler-plugin</artifactId> |
|
225 | 247 | </execution> |
226 | 248 | </executions> |
227 | 249 | </plugin> |
| 250 | + |
| 251 | + <!-- GPG 签名插件:对制品进行 PGP 签名(Maven Central 发布要求) --> |
228 | 252 | <plugin> |
229 | 253 | <groupId>org.apache.maven.plugins</groupId> |
230 | 254 | <artifactId>maven-gpg-plugin</artifactId> |
|
264 | 288 | <goals>deploy</goals> |
265 | 289 | </configuration> |
266 | 290 | </plugin> |
| 291 | + |
| 292 | + <!-- Maven 源码插件:打包 sources.jar(Maven Central 发布要求) --> |
267 | 293 | <plugin> |
268 | 294 | <groupId>org.apache.maven.plugins</groupId> |
269 | 295 | <artifactId>maven-source-plugin</artifactId> |
|
313 | 339 | </archive> |
314 | 340 | </configuration> |
315 | 341 | </plugin> |
| 342 | + |
| 343 | + <!-- Maven Javadoc 插件:打包 javadoc.jar(Maven Central 发布要求) --> |
316 | 344 | <plugin> |
317 | 345 | <groupId>org.apache.maven.plugins</groupId> |
318 | 346 | <artifactId>maven-javadoc-plugin</artifactId> |
|
333 | 361 | </execution> |
334 | 362 | </executions> |
335 | 363 | </plugin> |
| 364 | + |
| 365 | + <!-- Central Publishing 插件:发布制品到 Maven Central Portal --> |
336 | 366 | <plugin> |
337 | 367 | <groupId>org.sonatype.central</groupId> |
338 | 368 | <artifactId>central-publishing-maven-plugin</artifactId> |
|
347 | 377 | </plugins> |
348 | 378 | </pluginManagement> |
349 | 379 | <plugins> |
| 380 | + |
| 381 | + <!-- JaCoCo 覆盖率插件:生成覆盖率报告并校验测试覆盖率(目标 90%) --> |
350 | 382 | <plugin> |
351 | 383 | <groupId>org.jacoco</groupId> |
352 | 384 | <artifactId>jacoco-maven-plugin</artifactId> |
353 | | - <version>${jacoco-maven-plugin.version}</version> |
| 385 | + <version>${maven-jacoco-plugin.version}</version> |
354 | 386 | <executions> |
355 | 387 | <execution> |
356 | 388 | <id>prepare-agent</id> |
|
389 | 421 | </execution> |
390 | 422 | </executions> |
391 | 423 | </plugin> |
| 424 | + |
| 425 | + <!-- Maven 编译插件:统一 Java 版本参数与 Lombok 注解处理 --> |
392 | 426 | <plugin> |
393 | 427 | <groupId>org.apache.maven.plugins</groupId> |
394 | 428 | <artifactId>maven-compiler-plugin</artifactId> |
|
410 | 444 | </plugin> |
411 | 445 | </plugins> |
412 | 446 | </build> |
| 447 | + |
| 448 | + <!-- 构建 Profile 配置 --> |
413 | 449 | <profiles> |
414 | 450 | <profile> |
415 | 451 | <id>disable-javadoc-doclint</id> |
416 | 452 | <activation> |
417 | 453 | <jdk>[1.8,)</jdk> |
418 | 454 | </activation> |
| 455 | + |
| 456 | + <!-- 版本属性定义:Java 版本、依赖版本与 Maven 插件版本统一管理 --> |
419 | 457 | <properties> |
420 | 458 | <additionalparam>-Xdoclint:none -Xlint:unchecked</additionalparam> |
421 | 459 | </properties> |
422 | 460 | </profile> |
423 | 461 | <profile> |
424 | 462 | <id>release</id> |
| 463 | + |
| 464 | + <!-- 构建配置(Build) --> |
425 | 465 | <build> |
426 | 466 | <plugins> |
427 | 467 | <plugin> |
428 | 468 | <groupId>org.apache.maven.plugins</groupId> |
429 | 469 | <artifactId>maven-enforcer-plugin</artifactId> |
430 | 470 | </plugin> |
| 471 | + |
| 472 | + <!-- Maven 编译插件:统一 Java 版本参数与 Lombok 注解处理 --> |
431 | 473 | <plugin> |
432 | 474 | <groupId>org.apache.maven.plugins</groupId> |
433 | 475 | <artifactId>maven-compiler-plugin</artifactId> |
|
444 | 486 | <groupId>org.apache.maven.plugins</groupId> |
445 | 487 | <artifactId>maven-jar-plugin</artifactId> |
446 | 488 | </plugin> |
| 489 | + |
| 490 | + <!-- Maven 源码插件:打包 sources.jar(Maven Central 发布要求) --> |
447 | 491 | <plugin> |
448 | 492 | <groupId>org.apache.maven.plugins</groupId> |
449 | 493 | <artifactId>maven-source-plugin</artifactId> |
450 | 494 | </plugin> |
| 495 | + |
| 496 | + <!-- Maven Javadoc 插件:打包 javadoc.jar(Maven Central 发布要求) --> |
451 | 497 | <plugin> |
452 | 498 | <groupId>org.apache.maven.plugins</groupId> |
453 | 499 | <artifactId>maven-javadoc-plugin</artifactId> |
|
456 | 502 | <groupId>org.apache.maven.plugins</groupId> |
457 | 503 | <artifactId>maven-install-plugin</artifactId> |
458 | 504 | </plugin> |
| 505 | + |
| 506 | + <!-- GPG 签名插件:对制品进行 PGP 签名(Maven Central 发布要求) --> |
459 | 507 | <plugin> |
460 | 508 | <groupId>org.apache.maven.plugins</groupId> |
461 | 509 | <artifactId>maven-gpg-plugin</artifactId> |
|
468 | 516 | <groupId>org.apache.maven.plugins</groupId> |
469 | 517 | <artifactId>maven-release-plugin</artifactId> |
470 | 518 | </plugin> |
| 519 | + |
| 520 | + <!-- Central Publishing 插件:发布制品到 Maven Central Portal --> |
471 | 521 | <plugin> |
472 | 522 | <groupId>org.sonatype.central</groupId> |
473 | 523 | <artifactId>central-publishing-maven-plugin</artifactId> |
|
0 commit comments