Skip to content

fix: Publish platform maven artifact #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mgilbey
Copy link

@mgilbey mgilbey commented Feb 19, 2025

Publish a maven artifact for the java platform gradle module that is used to version dependencies across other modules. Without this being published, users attempting to resolve the shared or server modules in gradle from the github package registry will receive an error because the "kotlin-language-server:platform" dependency referenced in the shared and server module POM's cannot be found.

Reproduce The Problem

A minimal build.gradle in an empty folder can reproduce the problem. Needs credentials populated to access the package registry.

plugins {
    kotlin("jvm") version "2.1.0"
}
repositories {
    maven {
        name = "Github Maven Package Registry for kotlin-langauge-server"
        url = uri("https://maven.pkg.github.com/fwcd/kotlin-language-server")
        credentials {
            username = "YOUR_GITHUB_USER"
            password = "A_PERSONAL_ACCESS_TOKEN_FOR_YOUR_ACCOUNT"
        }
        content {
            includeGroup("kotlin-language-server")
        }
    }
}
dependencies {
    implementation("kotlin-language-server:server:1.3.13")
}

Running gradle dependencyInsight --dependency "kotlin-language-server" will yield the following problem.

% gradle dependencyInsight --dependency "kotlin-language-server"

> Task :dependencyInsight
kotlin-language-server:server:1.3.13 FAILED
   Failures:
      - Could not resolve kotlin-language-server:server:1.3.13.
          - Could not resolve kotlin-language-server:server:1.3.13.
              - Could not parse POM https://maven.pkg.github.com/fwcd/kotlin-language-server/kotlin-language-server/server/1.3.13/server-1.3.13.pom:
                  - Could not find kotlin-language-server:platform:1.3.13.
                    Searched in the following locations:
                      - https://maven.pkg.github.com/fwcd/kotlin-language-server/kotlin-language-server/platform/1.3.13/platform-1.3.13.pom
                  - If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.

kotlin-language-server:server:1.3.13 FAILED
\--- compileClasspath

The error message is a little confusing, but you can ignore the "cannot parse POM", the root cause here is "Could not find kotlin-language-server:platform:1.3.13."

With these changes, and pointing to a snapshot in a local maven repository, instead the module can be successfully retrieved:

> Task :dependencyInsight
kotlin-language-server:server:0.0.0-SNAPSHOT
  Variant apiElements:
    | Attribute Name                     | Provided     | Requested    |
    |------------------------------------|--------------|--------------|
    | org.gradle.status                  | integration  |              |
    | org.gradle.category                | library      | library      |
    | org.gradle.dependency.bundling     | external     | external     |
    | org.gradle.jvm.environment         | standard-jvm | standard-jvm |
    | org.gradle.jvm.version             | 11           | 23           |
    | org.gradle.libraryelements         | jar          | classes      |
    | org.gradle.usage                   | java-api     | java-api     |
    | org.jetbrains.kotlin.platform.type | jvm          | jvm          |

kotlin-language-server:server:0.0.0-SNAPSHOT
\--- compileClasspath

References

Publish a maven artifact for the java platform gradle module that is used to version dependencies across
other modules. Without this being published, users attempting to resolve the shared or server modules
in gradle from the github package registry will receive an error because the
"kotlin-language-server:platform" dependency referenced in the shared and server module POM's cannot be found.
@github-actions github-actions bot added ci-cd CI/CD-related (GitHub Actions) build Related to the language server's own build (including Gradle updates etc.) labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to the language server's own build (including Gradle updates etc.) ci-cd CI/CD-related (GitHub Actions)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants