You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/sdks/overview/java/publishing-to-maven-central.mdx
+30-23Lines changed: 30 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,32 +15,37 @@ page, you'll have a versioned package published on Maven Central.
15
15
16
16
<Steptitle="Configure `output` location">
17
17
18
-
Next, change the output location in `generators.yml` from `local-file-system` (the default) to `maven` to indicate that Fern should publish your package directly to the Maven Central registry:
Change the output location in `generators.yml` from `local-file-system` (the default) to `maven` to indicate that Fern should publish your package directly to the Maven Central registry.
19
+
20
+
Then, add `publish-to: central` to indicate that the publish target is the new Maven Central Portal (Sonatype). To publish to the legacy Nexus Repository, use `publish-to: ossrh`.
publish-to: central # Use 'central' for new Sonatype Central Portal (most common)
87
+
publish-to: central
85
88
github:
86
89
repository: your-org/company-java
87
90
```
@@ -103,7 +106,7 @@ groups:
103
106
104
107
Add `username: ${MAVEN_USERNAME}` and `password: ${MAVEN_PASSWORD}` to `generators.yml` to tell Fern to use the `MAVEN_USERNAME` and `MAVEN_PASSWORD` environment variable for authentication when publishing to the Maven Central registry.
105
108
106
-
```yaml {9-10}
109
+
```yaml {9-10} title="generators.yml"
107
110
groups:
108
111
java-sdk:
109
112
generators:
@@ -114,6 +117,8 @@ groups:
114
117
coordinate: com.company:sdk-name
115
118
username: ${MAVEN_USERNAME}
116
119
password: ${MAVEN_PASSWORD}
120
+
config:
121
+
publish-to: central
117
122
github:
118
123
repository: your-org/company-java
119
124
```
@@ -157,7 +162,7 @@ Export your key so you can store it in an environment variable later on:
157
162
158
163
Add the `keyId`, `password`, and `secretKey` from the previous step to `generators.yml`:
0 commit comments