Skip to content

Commit

Permalink
build(release): 更新 Maven 发布配置
Browse files Browse the repository at this point in the history
- 注释掉 distributionManagement 部分
- 添加 central-publishing-maven-plugin 替代 nexus-staging-maven-plugin
- 更新配置以适应新的发布流程
  • Loading branch information
fyjc-wlj committed Dec 2, 2024
1 parent df31243 commit 10b6e3b
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,16 @@
<profiles>
<profile>
<id>release</id>
<distributionManagement>
<snapshotRepository>
<id>maven-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>maven-repo</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<!-- <distributionManagement>-->
<!-- <snapshotRepository>-->
<!-- <id>maven-repo</id>-->
<!-- <url>https://oss.sonatype.org/content/repositories/snapshots/</url>-->
<!-- </snapshotRepository>-->
<!-- <repository>-->
<!-- <id>maven-repo</id>-->
<!-- <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>-->
<!-- </repository>-->
<!-- </distributionManagement>-->
<build>
<plugins>
<!-- Javadoc -->
Expand Down Expand Up @@ -293,15 +293,27 @@
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.sonatype.plugins</groupId>-->
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
<!-- <version>1.7.0</version>-->
<!-- <extensions>true</extensions>-->
<!-- <configuration>-->
<!-- <serverId>sonatype-nexus-staging</serverId>-->
<!-- <nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>-->
<!-- </configuration>-->
<!-- </plugin>-->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.6.0</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<!-- 这里的publishingServerId是在settings.xml中配置的server认证信息 -->
<!-- 注意 Github Action 中的 server-id 也要与此保持一致 -->
<publishingServerId>sonatype-nexus-staging</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit 10b6e3b

Please sign in to comment.