diff --git a/fern/products/sdks/overview/java/publishing-to-maven-central.mdx b/fern/products/sdks/overview/java/publishing-to-maven-central.mdx index 29e2d667c..fde26de75 100644 --- a/fern/products/sdks/overview/java/publishing-to-maven-central.mdx +++ b/fern/products/sdks/overview/java/publishing-to-maven-central.mdx @@ -4,8 +4,8 @@ description: How to publish the Fern Java SDK to Maven Central. --- Publish your public-facing Fern Java SDK to the [Maven Central -registry](https://pypi.org/). After following the steps on this page, -you'll have a versioned package published on Maven Central. +registry](https://central.sonatype.com/). After following the steps on this +page, you'll have a versioned package published on Maven Central. @@ -54,31 +54,12 @@ you'll have a versioned package published on Maven Central. ``` - - - - Add the `coordinate: groupId:artifactId` field to specify how your Java - SDK will be published and referenced in the Central Maven respository. - -```yaml {8} -groups: - java-sdk: - generators: - - name: fernapi/fern-java-sdk - version: - output: - location: maven - coordinate: com.company:sdk-name #: -``` - - - - + Add the path to your GitHub repository to `generators.yml`: -```yaml {9-10} +```yaml {8-9} groups: java-sdk: generators: @@ -86,7 +67,6 @@ groups: version: output: location: maven - coordinate: com.company:sdk-name github: repository: your-org/company-java ``` @@ -94,23 +74,51 @@ groups: -## Set up Maven Central publishing authentication via the Central Portal +## Set up Maven Central publishing authentication - Log into [Maven Central](https://pypi.org/) or create a new account. + Log into [Maven Central](https://central.sonatype.com/) or create a new account. + + + 1. Click on your username, then select **View Namespaces**. Click **Register New Namespace**. + 1. Enter your company website or GitHub account in reverse domain name format and go through the + verification process. + + + + + Add the namespace you just verified in Maven Central to the `coordinate: + groupId:artifactId` field. This specifies how your Java SDK will be + published and referenced in the Maven Central respository. + + ```yaml {8} + groups: + java-sdk: + generators: + - name: fernapi/fern-java-sdk + version: + output: + location: maven + coordinate: com.company:sdk-name # : + github: + repository: your-org/company-java + ``` + + + - 1. Click on your username, then select **View Account** - 1. Click on **Generate User Token**, then click **Ok** to confirm - generation. This will invalidate any existing token. + 1. Back in Maven Central, click on your username, then select **View Account** + 1. Click on **Generate User Token**, then click **Ok** to confirm + generation. This will invalidate any existing token. - Save your username and password tokens – they won’t be displayed after you leave the page. + Save your username and password tokens – they won’t be displayed after you leave the page. @@ -182,9 +190,9 @@ groups: username: ${MAVEN_USERNAME} password: ${MAVEN_PASSWORD} signature: - keyId: ${MAVEN_CENTRAL_SECRET_KEY_KEY_ID} - password: ${MAVEN_CENTRAL_SECRET_KEY_PASSWORD} - secretKey: ${MAVEN_CENTRAL_SECRET_KEY} + keyId: ${MAVEN_SIGNATURE_SECRET_KEY_ID} + password: ${MAVEN_SIGNATURE_PASSWORD} + secretKey: ${MAVEN_SIGNATURE_SECRET_KEY} github: repository: your-org/company-java ``` @@ -203,10 +211,10 @@ groups: ```bash export MAVEN_USERNAME=your-maven-username - export MAVEN_PASSWORD=your-maven-password - export MAVEN_CENTRAL_SECRET_KEY_KEY_ID=your-gpg-key-id - export MAVEN_CENTRAL_SECRET_KEY_PASSWORD=your-gpg-passphrase - export MAVEN_CENTRAL_SECRET_KEY=your-gpg-secret-key + export MAVEN_PASSWORD=your-maven-password + export MAVEN_SIGNATURE_SECRET_KEY_ID=your-gpg-key-id + export MAVEN_SIGNATURE_PASSWORD=your-gpg-passphrase + export MAVEN_SIGNATURE_SECRET_KEY=your-gpg-secret-key ```