Skip to content

Commit 2c9642c

Browse files
authored
Merge pull request #17 Update Publish Action to Publish to Maven Central
Update Publish Action to Publish to Maven Central
2 parents 2c128c6 + 08ce0c2 commit 2c9642c

File tree

2 files changed

+40
-32
lines changed

2 files changed

+40
-32
lines changed

.github/workflows/publishToMaven.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
- name: Set up Maven Central Repository
1212
uses: actions/setup-java@v3
1313
with:
14-
java-version: '8'
15-
distribution: 'temurin'
16-
server-id: ossrh
14+
java-version: "8"
15+
distribution: "temurin"
16+
server-id: central
1717
server-username: MAVEN_USERNAME
1818
server-password: MAVEN_PASSWORD
1919
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
@@ -28,8 +28,8 @@ jobs:
2828
- id: publish-to-central
2929
name: Publish to Central Repository
3030
env:
31-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
32-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
31+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
32+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
3333
OSSHR_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
3434
run: |
3535
mvn \

pom.xml

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xmlns="http://maven.apache.org/POM/4.0.0"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.garmin</groupId>
77
<artifactId>fit</artifactId>
@@ -67,10 +67,10 @@
6767
</configuration>
6868
<executions>
6969
<execution>
70-
<id>attach-sources</id>
71-
<goals>
72-
<goal>jar-no-fork</goal>
73-
</goals>
70+
<id>attach-sources</id>
71+
<goals>
72+
<goal>jar-no-fork</goal>
73+
</goals>
7474
</execution>
7575
</executions>
7676
</plugin>
@@ -86,10 +86,10 @@
8686
</configuration>
8787
<executions>
8888
<execution>
89-
<id>attach-javadocs</id>
90-
<goals>
91-
<goal>jar</goal>
92-
</goals>
89+
<id>attach-javadocs</id>
90+
<goals>
91+
<goal>jar</goal>
92+
</goals>
9393
</execution>
9494
</executions>
9595
</plugin>
@@ -100,32 +100,40 @@
100100
<version>1.5</version>
101101
<executions>
102102
<execution>
103-
<id>sign-artifacts</id>
104-
<phase>verify</phase>
105-
<goals>
106-
<goal>sign</goal>
107-
</goals>
108-
<configuration>
109-
<gpgArguments>
110-
<arg>--pinentry-mode</arg>
111-
<arg>loopback</arg>
112-
</gpgArguments>
113-
</configuration>
103+
<id>sign-artifacts</id>
104+
<phase>verify</phase>
105+
<goals>
106+
<goal>sign</goal>
107+
</goals>
108+
<configuration>
109+
<gpgArguments>
110+
<arg>--pinentry-mode</arg>
111+
<arg>loopback</arg>
112+
</gpgArguments>
113+
</configuration>
114114
</execution>
115115
</executions>
116116
</plugin>
117+
118+
<plugin>
119+
<groupId>org.sonatype.central</groupId>
120+
<artifactId>central-publishing-maven-plugin</artifactId>
121+
<version>0.9.0</version>
122+
<extensions>true</extensions>
123+
<configuration>
124+
<publishingServerId>central</publishingServerId>
125+
<deploymentName>com.garmin.fit-${project.version}</deploymentName>
126+
</configuration>
127+
</plugin>
117128
</plugins>
118129
</build>
119130

120131

121132
<distributionManagement>
122-
<snapshotRepository>
123-
<id>ossrh</id>
124-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
125-
</snapshotRepository>
126133
<repository>
127-
<id>ossrh</id>
128-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
134+
<id>central</id>
135+
<name>Maven Central Repository</name>
136+
<url>central.sonatype.com</url>
129137
</repository>
130138
</distributionManagement>
131139
</project>

0 commit comments

Comments
 (0)