Skip to content

Commit 9a339fa

Browse files
authored
Make small updates to Publishing to Maven Central page (#378)
1 parent 5f4417f commit 9a339fa

File tree

1 file changed

+45
-37
lines changed

1 file changed

+45
-37
lines changed

fern/products/sdks/overview/java/publishing-to-maven-central.mdx

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: How to publish the Fern Java SDK to Maven Central.
44
---
55

66
Publish your public-facing Fern Java SDK to the [Maven Central
7-
registry](https://pypi.org/). After following the steps on this page,
8-
you'll have a versioned package published on Maven Central.
7+
registry](https://central.sonatype.com/). After following the steps on this
8+
page, you'll have a versioned package published on Maven Central.
99

1010
<Markdown src="/products/sdks/snippets/setup-fern-folder-callout.mdx"/>
1111

@@ -54,63 +54,71 @@ you'll have a versioned package published on Maven Central.
5454

5555
```
5656
</Step>
57-
58-
<Step title="Configure Maven Coordinate">
59-
60-
Add the `coordinate: groupId:artifactId` field to specify how your Java
61-
SDK will be published and referenced in the Central Maven respository.
62-
63-
```yaml {8}
64-
groups:
65-
java-sdk:
66-
generators:
67-
- name: fernapi/fern-java-sdk
68-
version: <Markdown src="/snippets/version-number-java.mdx"/>
69-
output:
70-
location: maven
71-
coordinate: com.company:sdk-name #<company name in reverse domain name format>:<SDK name>
72-
```
73-
74-
</Step>
75-
76-
57+
7758
<Step title="Add repository location">
7859

7960
Add the path to your GitHub repository to `generators.yml`:
8061

81-
```yaml {9-10}
62+
```yaml {8-9}
8263
groups:
8364
java-sdk:
8465
generators:
8566
- name: fernapi/fern-java-sdk
8667
version: <Markdown src="/snippets/version-number-java.mdx"/>
8768
output:
8869
location: maven
89-
coordinate: com.company:sdk-name
9070
github:
9171
repository: your-org/company-java
9272
```
9373
9474
</Step>
9575
</Steps>
9676
97-
## Set up Maven Central publishing authentication via the Central Portal
77+
## Set up Maven Central publishing authentication
9878
9979
<Steps>
10080
10181
<Step title="Log into Maven Central">
10282
103-
Log into [Maven Central](https://pypi.org/) or create a new account.
83+
Log into [Maven Central](https://central.sonatype.com/) or create a new account.
10484
10585
</Step>
10686
87+
<Step title="Verify your namespace">
88+
89+
1. Click on your username, then select **View Namespaces**. Click **Register New Namespace**.
90+
1. Enter your company website or GitHub account in reverse domain name format and go through the
91+
verification process.
92+
93+
</Step>
94+
<Step title="Configure Maven Coordinate">
95+
96+
Add the namespace you just verified in Maven Central to the `coordinate:
97+
groupId:artifactId` field. This specifies how your Java SDK will be
98+
published and referenced in the Maven Central respository.
99+
100+
```yaml {8}
101+
groups:
102+
java-sdk:
103+
generators:
104+
- name: fernapi/fern-java-sdk
105+
version: <Markdown src="/snippets/version-number-java.mdx"/>
106+
output:
107+
location: maven
108+
coordinate: com.company:sdk-name # <company name in reverse domain name format>:<SDK name>
109+
github:
110+
repository: your-org/company-java
111+
```
112+
113+
</Step>
114+
107115
<Step title="Generate user tokens">
108116

109-
1. Click on your username, then select **View Account**
110-
1. Click on **Generate User Token**, then click **Ok** to confirm
111-
generation. This will invalidate any existing token.
117+
1. Back in Maven Central, click on your username, then select **View Account**
118+
1. Click on **Generate User Token**, then click **Ok** to confirm
119+
generation. This will invalidate any existing token.
112120

113-
<Warning>Save your username and password tokens – they won’t be displayed after you leave the page.</Warning>
121+
<Warning>Save your username and password tokens – they won’t be displayed after you leave the page.</Warning>
114122

115123
</Step>
116124

@@ -182,9 +190,9 @@ groups:
182190
username: ${MAVEN_USERNAME}
183191
password: ${MAVEN_PASSWORD}
184192
signature:
185-
keyId: ${MAVEN_CENTRAL_SECRET_KEY_KEY_ID}
186-
password: ${MAVEN_CENTRAL_SECRET_KEY_PASSWORD}
187-
secretKey: ${MAVEN_CENTRAL_SECRET_KEY}
193+
keyId: ${MAVEN_SIGNATURE_SECRET_KEY_ID}
194+
password: ${MAVEN_SIGNATURE_PASSWORD}
195+
secretKey: ${MAVEN_SIGNATURE_SECRET_KEY}
188196
github:
189197
repository: your-org/company-java
190198
```
@@ -203,10 +211,10 @@ groups:
203211

204212
```bash
205213
export MAVEN_USERNAME=your-maven-username
206-
export MAVEN_PASSWORD=your-maven-password
207-
export MAVEN_CENTRAL_SECRET_KEY_KEY_ID=your-gpg-key-id
208-
export MAVEN_CENTRAL_SECRET_KEY_PASSWORD=your-gpg-passphrase
209-
export MAVEN_CENTRAL_SECRET_KEY=your-gpg-secret-key
214+
export MAVEN_PASSWORD=your-maven-password
215+
export MAVEN_SIGNATURE_SECRET_KEY_ID=your-gpg-key-id
216+
export MAVEN_SIGNATURE_PASSWORD=your-gpg-passphrase
217+
export MAVEN_SIGNATURE_SECRET_KEY=your-gpg-secret-key
210218
```
211219

212220
</Step>

0 commit comments

Comments
 (0)