Hi. Using gradle, how publish the jsJar of a proje...
# multiplatform
d
Hi. Using gradle, how publish the jsJar of a project to a maven repository?
r
you can use
maven-publish
plugin just like for other artifacts
d
Hi I am having an issue with the last line:
Copy code
publishing {
    publications {
        create<MavenPublication>("mavenJava") {
            artifactId = "my-library"
            from(components["java"])
There is no java component, what should this be. Do you have a working example. Thanks
r
Copy code
publishing {
    publications {
        create<MavenPublication>("kotlin") {
            from(components["kotlin"])
            pom {
               // ...
            }
        }
    }
}
you can look how my project is published, but it's configured inside
buildSrc
sources so it's a bit different than plain `build.gradle.kts`: https://github.com/rjaros/kvision/blob/master/buildSrc/src/main/kotlin/Shared.kt https://github.com/rjaros/kvision/blob/master/build.gradle.kts#L57
d
Doh! Cant believe I didnt try that! However, I think that the 3 options mentioned here https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html#org.gradle.api.publish.maven.MavenPublication:from(org.gradle.api.component.SoftwareComponent) are what confused me. Many Thanks