build: 优化多模块发布打包流程
- 升级源码、Javadoc 与 Central 发布插件并消除链接误报 - 将发布附件收敛到 release profile 并更新构建说明
This commit is contained in:
@@ -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
|
||||
|
||||
110
pom.xml
110
pom.xml
@@ -501,60 +501,67 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Source -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Javadoc -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.4</version>
|
||||
<configuration>
|
||||
<windowtitle>EasyAgents</windowtitle>
|
||||
<doctitle>EasyAgents</doctitle>
|
||||
<show>private</show>
|
||||
<detectLinks>false</detectLinks>
|
||||
<detectOfflineLinks>true</detectOfflineLinks>
|
||||
<linksource>true</linksource>
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
<detectJavaApiLink>true</detectJavaApiLink>
|
||||
<source>17</source>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
<version>0.7.0</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<publishingServerId>central</publishingServerId>
|
||||
<autoPublish>true</autoPublish>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.12.0</version>
|
||||
<configuration>
|
||||
<windowtitle>EasyAgents</windowtitle>
|
||||
<doctitle>EasyAgents</doctitle>
|
||||
<show>private</show>
|
||||
<detectLinks>false</detectLinks>
|
||||
<detectOfflineLinks>false</detectOfflineLinks>
|
||||
<linksource>true</linksource>
|
||||
<doclint>none</doclint>
|
||||
<detectJavaApiLink>true</detectJavaApiLink>
|
||||
<release>${maven.compiler.release}</release>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<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>
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user