Skip to content

Conversation

bencehornak
Copy link
Contributor

@bencehornak bencehornak commented Aug 18, 2025

This PR

Fixes the publication errors:

> Task :kotlin-sdk:publishReleasePublicationToSonatypeRepository
Multiple publications with coordinates 'dev.openfeature:kotlin-sdk:0.6.1' are published to repository 'sonatype'. The publications 'kotlinMultiplatform' in project ':kotlin-sdk' and 'release' in project ':kotlin-sdk' will overwrite each other!
> Task :kotlin-sdk:publishToSonatype
FAILURE: Build failed with an exception.
> Task :closeSonatypeStagingRepository FAILED
* What went wrong:
Execution failed for task ':closeSonatypeStagingRepository'.
> Failed to close staging repository, server at https://ossrh-staging-api.central.sonatype.com/service/local/ responded with status code 400, body: Failed to process request: Deployment reached an unexpected status: Failed
  pkg:maven/dev.openfeature/kotlin-sdk-jvm@0.6.1
  - Javadocs must be provided but not found in entries
  - Missing signature for file: kotlin-sdk-jvm-0.6.1.module
  - Missing signature for file: kotlin-sdk-jvm-0.6.1.pom
  - Missing signature for file: kotlin-sdk-jvm-0.6.1-sources.jar
  - Missing signature for file: kotlin-sdk-jvm-0.6.1.jar
  - Project name is missing
  - Project description is missing
  - Project URL is not defined
  - License information is missing
  - SCM URL is not defined
  - Developers information is missing
  pkg:maven/dev.openfeature/kotlin-sdk-js@0.6.1?type=klib
  - Missing signature for file: kotlin-sdk-js-0.6.1.module
  - Missing signature for file: kotlin-sdk-js-0.6.1-sources.jar
  - Missing signature for file: kotlin-sdk-js-0.6.1.klib
  - Missing signature for file: kotlin-sdk-js-0.6.1.pom
  pkg:maven/dev.openfeature/kotlin-sdk-js@0.6.1
  - Project name is missing
  - Project description is missing
  - Project URL is not defined
  - License information is missing
  - SCM URL is not defined
  - Developers information is missing
  pkg:maven/dev.openfeature/kotlin-sdk@0.6.1?type=aar
  - Missing signature for file: kotlin-sdk-0.6.1.jar
  - Missing signature for file: kotlin-sdk-0.6.1-kotlin-tooling-metadata.json
  pkg:maven/dev.openfeature/kotlin-sdk-linuxx64@0.6.1?type=klib
  - Missing signature for file: kotlin-sdk-linuxx64-0.6.1.klib
  - Missing signature for file: kotlin-sdk-linuxx64-0.6.1-sources.jar
  - Missing signature for file: kotlin-sdk-linuxx64-0.6.1.module
  - Missing signature for file: kotlin-sdk-linuxx64-0.6.1.pom
  pkg:maven/dev.openfeature/kotlin-sdk-linuxx64@0.6.1
  - Project name is missing
  - Project description is missing
  - Project URL is not defined
  - License information is missing
  - SCM URL is not defined
  - Developers information is missing
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org/.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':closeSonatypeStagingRepository'.

Notes

I have set up Dokka to generate docs in the typical Kotlin template. I've decided to adopt the recently released alpha v2 config syntax, because v1 will eventually be deprecated.

For packaging the Dokka HTML output as an old-school javadoc jar I've made use of the popular Gradle Maven Publish Plugin by vanniktech, which is used by Ktor and OkHttp just two mention two popular ones.

How to test

Dokka

Execute

./gradlew dokkaGeneratePublicationHtml

It will place the generated docs in kotlin-sdk/build/dokka. You can also double check that the (source) links point to the right GitHub URLs.

Local publication

If you have the code signing locally configured, you can execute ./gradlew publishToMavenLocal. This will place the generated files under /home/bence/.m2/repository/dev/openfeature/.

(If you don't have code signing, comment out signAllPublications() in kotlin-sdk/build.gradle.kts)

For me it generated the following files, hopefully everything that is required by the Sonatype repository:

./kotlin-sdk
./kotlin-sdk/0.6.1
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1.pom.asc
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1.jar.asc
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1.pom
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1.module
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1.jar
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1-sources.jar
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1-javadoc.jar.asc
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1.module.asc
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1-sources.jar.asc
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1-kotlin-tooling-metadata.json
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1-javadoc.jar
./kotlin-sdk/0.6.1/kotlin-sdk-0.6.1-kotlin-tooling-metadata.json.asc
./kotlin-sdk/maven-metadata-local.xml
./kotlin-sdk-js
./kotlin-sdk-js/0.6.1
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1.pom.asc
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1.klib
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1-javadoc.jar
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1.module.asc
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1-sources.jar.asc
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1.module
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1.pom
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1-sources.jar
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1.klib.asc
./kotlin-sdk-js/0.6.1/kotlin-sdk-js-0.6.1-javadoc.jar.asc
./kotlin-sdk-js/maven-metadata-local.xml
./kotlin-sdk-linuxx64
./kotlin-sdk-linuxx64/0.6.1
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1.module.asc
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1.module
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1.pom.asc
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1-sources.jar
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1.pom
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1-sources.jar.asc
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1.klib.asc
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1.klib
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1-javadoc.jar
./kotlin-sdk-linuxx64/0.6.1/kotlin-sdk-linuxx64-0.6.1-javadoc.jar.asc
./kotlin-sdk-linuxx64/maven-metadata-local.xml
./kotlin-sdk-android
./kotlin-sdk-android/0.6.1
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1-javadoc.jar.asc
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1.pom.asc
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1-sources.jar.asc
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1-sources.jar
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1-javadoc.jar
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1.module
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1.aar.asc
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1.pom
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1.module.asc
./kotlin-sdk-android/0.6.1/kotlin-sdk-android-0.6.1.aar
./kotlin-sdk-android/maven-metadata-local.xml
./kotlin-sdk-jvm
./kotlin-sdk-jvm/0.6.1
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1.module
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1.jar.asc
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1-javadoc.jar.asc
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1.jar
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1.pom
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1-javadoc.jar
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1-sources.jar
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1.module.asc
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1.pom.asc
./kotlin-sdk-jvm/0.6.1/kotlin-sdk-jvm-0.6.1-sources.jar.asc
./kotlin-sdk-jvm/maven-metadata-local.xml

If you extract the javadoc jars, they should contain the html docs.

Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
@bencehornak bencehornak changed the title Fix publication fix: fix publication Aug 18, 2025
Copy link
Member

@nicklasl nicklasl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't used com.vanniktech.maven.publish but this looks reasonable 👍

@nicklasl nicklasl merged commit c1284aa into open-feature:main Aug 19, 2025
8 of 9 checks passed
bencehornak added a commit to open-feature/kotlin-sdk-contrib that referenced this pull request Aug 26, 2025
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR

- Upgrades to the first Multiplatform-compatible Kotlin SDK version,
which allows the CI to finally pass.
- Sets up Dokka and publishing (using the [Gradle Maven Publish Plugin
by
vanniktech](https://vanniktech.github.io/gradle-maven-publish-plugin/))
similar to open-feature/kotlin-sdk#166

### Follow-up Tasks

Release Please can eventually be set up after this (#2).

### How to test
<!-- if applicable, add testing instructions under this section -->

The CI should pass for the first time. The publishing can be tested with
`./gradlew publishToMavenLocal`. It should create the artifacts of the
env-var provider under
`~/.m2/repository/dev/openfeature/kotlin/contrib/providers/`.

---------

Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants