build: 优化多模块发布打包流程
- 升级源码、Javadoc 与 Central 发布插件并消除链接误报 - 将发布附件收敛到 release profile 并更新构建说明
This commit is contained in:
@@ -39,11 +39,17 @@ Easy-Agents 是一个轻量、可扩展的 Java AI 应用开发框架,覆盖
|
|||||||
在项目根目录执行:
|
在项目根目录执行:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mvn -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true clean install
|
mvn -DskipTests clean install
|
||||||
```
|
```
|
||||||
|
|
||||||
构建完成后,相关构件会安装到本地 Maven 仓库,可供 `easyflow` 等项目直接依赖。
|
构建完成后,相关构件会安装到本地 Maven 仓库,可供 `easyflow` 等项目直接依赖。
|
||||||
|
|
||||||
|
发布时启用 `release` profile,生成源码包和 Javadoc 包,并调用 Maven Central 发布插件:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mvn -Prelease -DskipTests deploy
|
||||||
|
```
|
||||||
|
|
||||||
## 快速示例
|
## 快速示例
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
|||||||
28
pom.xml
28
pom.xml
@@ -501,14 +501,21 @@
|
|||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
<!-- Source -->
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>release</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
<version>2.2.1</version>
|
<version>3.4.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>jar-no-fork</goal>
|
<goal>jar-no-fork</goal>
|
||||||
@@ -516,25 +523,25 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- Javadoc -->
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>2.10.4</version>
|
<version>3.12.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<windowtitle>EasyAgents</windowtitle>
|
<windowtitle>EasyAgents</windowtitle>
|
||||||
<doctitle>EasyAgents</doctitle>
|
<doctitle>EasyAgents</doctitle>
|
||||||
<show>private</show>
|
<show>private</show>
|
||||||
<detectLinks>false</detectLinks>
|
<detectLinks>false</detectLinks>
|
||||||
<detectOfflineLinks>true</detectOfflineLinks>
|
<detectOfflineLinks>false</detectOfflineLinks>
|
||||||
<linksource>true</linksource>
|
<linksource>true</linksource>
|
||||||
<additionalparam>-Xdoclint:none</additionalparam>
|
<doclint>none</doclint>
|
||||||
<detectJavaApiLink>true</detectJavaApiLink>
|
<detectJavaApiLink>true</detectJavaApiLink>
|
||||||
<source>17</source>
|
<release>${maven.compiler.release}</release>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-javadocs</id>
|
<id>attach-javadocs</id>
|
||||||
|
<phase>package</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>jar</goal>
|
<goal>jar</goal>
|
||||||
</goals>
|
</goals>
|
||||||
@@ -544,17 +551,17 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.sonatype.central</groupId>
|
<groupId>org.sonatype.central</groupId>
|
||||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||||
<version>0.7.0</version>
|
<version>0.11.0</version>
|
||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<publishingServerId>central</publishingServerId>
|
<publishingServerId>central</publishingServerId>
|
||||||
<autoPublish>true</autoPublish>
|
<autoPublish>true</autoPublish>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<!-- 跳过测试:mvn package -Dmaven.test.skip=true -->
|
<!-- 跳过测试:mvn package -Dmaven.test.skip=true -->
|
||||||
<!-- 检测依赖最新版本:mvn versions:display-dependency-updates -->
|
<!-- 检测依赖最新版本:mvn versions:display-dependency-updates -->
|
||||||
@@ -564,6 +571,5 @@
|
|||||||
|
|
||||||
<!-- mvn clean source:jar install -->
|
<!-- mvn clean source:jar install -->
|
||||||
<!-- mvn deploy -Dmaven.test.skip=true -e -P release -->
|
<!-- mvn deploy -Dmaven.test.skip=true -e -P release -->
|
||||||
<!-- mvn deploy -e -->
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
Reference in New Issue
Block a user