docs:update maven publish.

2020
Haotian Zhang 3 months ago
parent 2fecfc50f4
commit f583c30205

@ -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

@ -40,11 +40,11 @@ jobs:
with: with:
java-version: '17' java-version: '17'
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 }}

@ -215,6 +215,31 @@
<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>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<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>
@ -257,33 +282,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>
<version>${maven-source-plugin.version}</version>
<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>
@ -301,12 +299,24 @@
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile> </profiles>
<id>sonatype</id>
<distributionManagement>
<snapshotRepository>
<id>central-portal</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>central-portal</id>
<url>https://ossrh-staging-api.central.sonatype.com/service/local/</url>
</repository>
</distributionManagement>
<repositories> <repositories>
<repository> <repository>
<id>nexus-snapshots</id> <name>Central Portal Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url> <id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases> <releases>
<enabled>false</enabled> <enabled>false</enabled>
</releases> </releases>
@ -315,28 +325,5 @@
<updatePolicy>always</updatePolicy> <updatePolicy>always</updatePolicy>
</snapshots> </snapshots>
</repository> </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> </repositories>
</profile>
</profiles>
<distributionManagement>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>nexus-releases</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project> </project>

@ -326,6 +326,32 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.verison}</version>
<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>
<version>${maven-source-plugin.version}</version>
<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>
@ -359,34 +385,6 @@
<id>release</id> <id>release</id>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.verison}</version>
<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>
<version>${maven-source-plugin.version}</version>
<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>
@ -407,12 +405,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