build: 优化多模块发布打包流程

- 升级源码、Javadoc 与 Central 发布插件并消除链接误报

- 将发布附件收敛到 release profile 并更新构建说明
This commit is contained in:
2026-07-23 20:19:23 +08:00
parent 5b6b2db5d8
commit e995088d79
2 changed files with 65 additions and 53 deletions

View File

@@ -39,11 +39,17 @@ Easy-Agents 是一个轻量、可扩展的 Java AI 应用开发框架,覆盖
在项目根目录执行:
```bash
mvn -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true clean install
mvn -DskipTests clean install
```
构建完成后,相关构件会安装到本地 Maven 仓库,可供 `easyflow` 等项目直接依赖。
发布时启用 `release` profile生成源码包和 Javadoc 包,并调用 Maven Central 发布插件:
```bash
mvn -Prelease -DskipTests deploy
```
## 快速示例
```java

28
pom.xml
View File

@@ -501,14 +501,21 @@
</executions>
</plugin>
</plugins>
</build>
<!-- Source -->
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
@@ -516,25 +523,25 @@
</execution>
</executions>
</plugin>
<!-- Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<version>3.12.0</version>
<configuration>
<windowtitle>EasyAgents</windowtitle>
<doctitle>EasyAgents</doctitle>
<show>private</show>
<detectLinks>false</detectLinks>
<detectOfflineLinks>true</detectOfflineLinks>
<detectOfflineLinks>false</detectOfflineLinks>
<linksource>true</linksource>
<additionalparam>-Xdoclint:none</additionalparam>
<doclint>none</doclint>
<detectJavaApiLink>true</detectJavaApiLink>
<source>17</source>
<release>${maven.compiler.release}</release>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
@@ -544,17 +551,17 @@
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<version>0.11.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- 跳过测试mvn package -Dmaven.test.skip=true -->
<!-- 检测依赖最新版本mvn versions:display-dependency-updates -->
@@ -564,6 +571,5 @@
<!-- mvn clean source:jar install -->
<!-- mvn deploy -Dmaven.test.skip=true -e -P release -->
<!-- mvn deploy -e -->
</project>