docs:update maven publish.

pull/1614/head
Haotian Zhang 3 months ago
parent 60187f46d7
commit 64eaff5d91

@ -14,14 +14,14 @@ jobs:
with: with:
java-version: '17' java-version: '17'
distribution: 'temurin' distribution: 'temurin'
server-id: nexus-releases server-id: central-portal
server-username: MAVEN_USERNAME server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD server-password: MAVEN_PASSWORD
- name: Publish package - name: Publish package
env: env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_USERNAME: ${{ secrets.CENTRAL_PORTAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} MAVEN_PASSWORD: ${{ secrets.CENTRAL_PORTAL_TOKEN }}
run: | run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import; cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import;
mvn clean deploy -U -P release -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -DskipTests mvn clean deploy -B -U -P release -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -Dmaven.test.skip=true

@ -69,11 +69,11 @@ jobs:
with: with:
java-version: ${{ needs.set-jdk.outputs.jdk }} java-version: ${{ needs.set-jdk.outputs.jdk }}
distribution: 'temurin' distribution: 'temurin'
server-id: nexus-snapshots server-id: central-portal
server-username: MAVEN_USERNAME server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD server-password: MAVEN_PASSWORD
- name: Publish package - name: Publish package
run: mvn clean deploy -B -U -Psonatype run: mvn clean deploy -B -U -Dmaven.test.skip=true
env: env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_USERNAME: ${{ secrets.CENTRAL_PORTAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} MAVEN_PASSWORD: ${{ secrets.CENTRAL_PORTAL_TOKEN }}

@ -104,7 +104,6 @@
<!-- Maven Plugin Versions --> <!-- Maven Plugin Versions -->
<jacoco.version>0.8.12</jacoco.version> <jacoco.version>0.8.12</jacoco.version>
<flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version> <flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
<maven-shade-plugin.version>3.5.1</maven-shade-plugin.version>
<maven-clean-plugin.version>3.4.0</maven-clean-plugin.version> <maven-clean-plugin.version>3.4.0</maven-clean-plugin.version>
<!-- Checkstyle --> <!-- Checkstyle -->
@ -194,16 +193,6 @@
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version> <version>${jacoco.version}</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>
@ -214,6 +203,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
<configuration> <configuration>
<filesets> <filesets>
<fileset> <fileset>
@ -236,7 +226,6 @@
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions> <executions>
<execution> <execution>
<id>jacoco-initialize</id> <id>jacoco-initialize</id>
@ -263,6 +252,18 @@
<argLine>${argLine}</argLine> <argLine>${argLine}</argLine>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId> <artifactId>flatten-maven-plugin</artifactId>
@ -305,32 +306,6 @@
<id>release</id> <id>release</id>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
@ -347,42 +322,31 @@
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile>
<id>sonatype</id>
<repositories>
<repository>
<id>nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>nexus-releases</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles> </profiles>
<distributionManagement> <distributionManagement>
<snapshotRepository> <snapshotRepository>
<id>nexus-snapshots</id> <id>central-portal</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url> <url>https://central.sonatype.com/repository/maven-snapshots/</url>
</snapshotRepository> </snapshotRepository>
<repository> <repository>
<id>nexus-releases</id> <id>central-portal</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> <url>https://ossrh-staging-api.central.sonatype.com/service/local/</url>
</repository> </repository>
</distributionManagement> </distributionManagement>
<repositories>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
</project> </project>

@ -289,6 +289,30 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId> <artifactId>flatten-maven-plugin</artifactId>
@ -322,32 +346,6 @@
<id>release</id> <id>release</id>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
@ -367,12 +365,27 @@
<distributionManagement> <distributionManagement>
<snapshotRepository> <snapshotRepository>
<id>nexus-snapshots</id> <id>central-portal</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url> <url>https://central.sonatype.com/repository/maven-snapshots/</url>
</snapshotRepository> </snapshotRepository>
<repository> <repository>
<id>nexus-releases</id> <id>central-portal</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> <url>https://ossrh-staging-api.central.sonatype.com/service/local/</url>
</repository> </repository>
</distributionManagement> </distributionManagement>
<repositories>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
</project> </project>

Loading…
Cancel
Save