Skip to content

Commit 3bb31ea

Browse files
committed
docs:update maven publish.
1 parent ccb6d82 commit 3bb31ea

File tree

3 files changed

+50
-95
lines changed

3 files changed

+50
-95
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
with:
1515
java-version: '8'
1616
distribution: 'temurin'
17-
server-id: ossrh
17+
server-id: central-portal
1818
server-username: MAVEN_USERNAME
1919
server-password: MAVEN_PASSWORD
2020

2121
- name: "Publish package"
2222
env:
23-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
24-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
23+
MAVEN_USERNAME: ${{ secrets.CENTRAL_PORTAL_USERNAME }}
24+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_PORTAL_TOKEN }}
2525
run: |
2626
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import;
2727
mvn clean deploy -P release -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -DskipTests -B -U

.github/workflows/snapshot.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
with:
3737
java-version: '8'
3838
distribution: 'temurin'
39-
server-id: ossrh
39+
server-id: central-portal
4040
server-username: MAVEN_USERNAME
4141
server-password: MAVEN_PASSWORD
4242
- name: Publish package
43-
run: mvn --batch-mode -U -Psonatype clean deploy -DskipTests
43+
run: mvn --batch-mode -U clean deploy -DskipTests
4444
env:
45-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
46-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
45+
MAVEN_USERNAME: ${{ secrets.CENTRAL_PORTAL_USERNAME }}
46+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_PORTAL_TOKEN }}

pom.xml

Lines changed: 43 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
<execution>
218218
<id>attach-sources</id>
219219
<goals>
220-
<goal>jar</goal>
220+
<goal>jar-no-fork</goal>
221221
</goals>
222222
</execution>
223223
</executions>
@@ -229,6 +229,7 @@
229229
<executions>
230230
<execution>
231231
<id>attach-javadocs</id>
232+
<phase>package</phase>
232233
<goals>
233234
<goal>jar</goal>
234235
</goals>
@@ -240,6 +241,20 @@
240241
<name>date</name>
241242
</tag>
242243
</tags>
244+
<show>public</show>
245+
<charset>UTF-8</charset>
246+
<encoding>UTF-8</encoding>
247+
<docencoding>UTF-8</docencoding>
248+
<links>
249+
<link>http://docs.oracle.com/javase/8/docs/api</link>
250+
</links>
251+
<doclint>none</doclint>
252+
<excludePackageNames>
253+
com.tencent.polaris.*.example,com.tencent.polaris.*.example.*
254+
</excludePackageNames>
255+
<doctitle>Tencent Polaris Java SDK ${project.version} API</doctitle>
256+
<windowtitle>Tencent Polaris Java SDK ${project.version} API
257+
</windowtitle>
243258
</configuration>
244259
</plugin>
245260
<plugin>
@@ -282,36 +297,18 @@
282297
</filesets>
283298
</configuration>
284299
</plugin>
300+
<plugin>
301+
<groupId>org.apache.maven.plugins</groupId>
302+
<artifactId>maven-deploy-plugin</artifactId>
303+
<version>${maven.deploy.plugin.version}</version>
304+
<configuration>
305+
<skip>${skip.maven.deploy}</skip>
306+
</configuration>
307+
</plugin>
285308
</plugins>
286309
</build>
287310

288311
<profiles>
289-
<profile>
290-
<id>sonatype</id>
291-
<repositories>
292-
<repository>
293-
<id>nexus-snapshots</id>
294-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
295-
<releases>
296-
<enabled>false</enabled>
297-
</releases>
298-
<snapshots>
299-
<enabled>true</enabled>
300-
<updatePolicy>always</updatePolicy>
301-
</snapshots>
302-
</repository>
303-
<repository>
304-
<id>nexus-releases</id>
305-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
306-
<releases>
307-
<enabled>true</enabled>
308-
</releases>
309-
<snapshots>
310-
<enabled>false</enabled>
311-
</snapshots>
312-
</repository>
313-
</repositories>
314-
</profile>
315312
<profile>
316313
<id>javadoc-lint</id>
317314
<activation>
@@ -325,14 +322,6 @@
325322
<id>release</id>
326323
<build>
327324
<plugins>
328-
<plugin>
329-
<groupId>org.apache.maven.plugins</groupId>
330-
<artifactId>maven-deploy-plugin</artifactId>
331-
<version>${maven.deploy.plugin.version}</version>
332-
<configuration>
333-
<skip>${skip.maven.deploy}</skip>
334-
</configuration>
335-
</plugin>
336325
<plugin>
337326
<groupId>org.apache.maven.plugins</groupId>
338327
<artifactId>maven-gpg-plugin</artifactId>
@@ -347,68 +336,34 @@
347336
</execution>
348337
</executions>
349338
</plugin>
350-
<plugin>
351-
<groupId>org.apache.maven.plugins</groupId>
352-
<artifactId>maven-source-plugin</artifactId>
353-
<version>${maven.source.plugin.version}</version>
354-
<executions>
355-
<execution>
356-
<id>attach-sources</id>
357-
<goals>
358-
<goal>jar-no-fork</goal>
359-
</goals>
360-
</execution>
361-
</executions>
362-
</plugin>
363-
<plugin>
364-
<groupId>org.apache.maven.plugins</groupId>
365-
<artifactId>maven-javadoc-plugin</artifactId>
366-
<version>${maven.javadoc.plugin.version}</version>
367-
<executions>
368-
<execution>
369-
<id>attach-javadocs</id>
370-
<phase>package</phase>
371-
<goals>
372-
<goal>jar</goal>
373-
</goals>
374-
</execution>
375-
</executions>
376-
<configuration>
377-
<tags>
378-
<tag>
379-
<name>date</name>
380-
</tag>
381-
</tags>
382-
<show>public</show>
383-
<charset>UTF-8</charset>
384-
<encoding>UTF-8</encoding>
385-
<docencoding>UTF-8</docencoding>
386-
<links>
387-
<link>http://docs.oracle.com/javase/8/docs/api</link>
388-
</links>
389-
<doclint>none</doclint>
390-
<excludePackageNames>
391-
com.tencent.polaris.*.example,com.tencent.polaris.*.example.*
392-
</excludePackageNames>
393-
<doctitle>Tencent Polaris Java SDK ${project.version} API</doctitle>
394-
<windowtitle>Tencent Polaris Java SDK ${project.version} API
395-
</windowtitle>
396-
</configuration>
397-
</plugin>
398339
</plugins>
399340
</build>
400341
</profile>
401342
</profiles>
402343

403344
<distributionManagement>
404345
<snapshotRepository>
405-
<id>ossrh</id>
406-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
407-
346+
<id>central-portal</id>
347+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
408348
</snapshotRepository>
409349
<repository>
410-
<id>ossrh</id>
411-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
350+
<id>central-portal</id>
351+
<url>https://ossrh-staging-api.central.sonatype.com/service/local/</url>
412352
</repository>
413353
</distributionManagement>
354+
355+
<repositories>
356+
<repository>
357+
<name>Central Portal Snapshots</name>
358+
<id>central-portal-snapshots</id>
359+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
360+
<releases>
361+
<enabled>false</enabled>
362+
</releases>
363+
<snapshots>
364+
<enabled>true</enabled>
365+
<updatePolicy>always</updatePolicy>
366+
</snapshots>
367+
</repository>
368+
</repositories>
414369
</project>

0 commit comments

Comments
 (0)