https://kotlinlang.org logo
Title
j

Javier

12/07/2020, 8:13 PM
I have a multimodule (multiplatform) setup where I have two modules,
moduleA
and
moduleB
I have a normal configuration for
maven-publish
that works to publish my project to
MavenCentral
but that was working when I had only one module. After adding the
moduleB
to my project which depends on
moduleA
, I can't build my project. This is the stack trace I get: https://pastebin.com/9cR34djM
My
maven-publish
setup for one module:
plugins {
    id("maven-publish")
    `java-library`
    signing
}

java {
    withJavadocJar()
}

signing {
    useGpgCmd()
    sign(publishing.publications)
}

val isReleaseEnv: Boolean? = System.getenv("isRelease")?.toBoolean()
val isRelease: String by project

publishing {
    publications.withType<MavenPublication> {
        pom {
            name.set("...")
            description.set("...")
            url.set("<http://github.com/.../>...")
            licenses {
                license {
                    name.set("The Apache License, Version 2.0")
                    url.set("<http://www.apache.org/licenses/LICENSE-2.0.txt>")
                }
            }
            developers {
                developer {
                    id.set("...")
                    name.set("...")
                    email.set("...")
                }
            }
            scm {
                url.set("<https://github.com/.../>...")
                connection.set("scm:git:<https://github.com/.../....git>")
                developerConnection.set("scm:git:git@github.com:.../....git")
            }
        }
        repositories {
            val releasesRepo = "<https://oss.sonatype.org/service/local/staging/deploy/maven2>"
            val snapshotsRepo = "<https://oss.sonatype.org/content/repositories/snapshots>"

            maven(if (isReleaseEnv ?: isRelease.toBoolean()) releasesRepo else snapshotsRepo) {
                credentials {
                    username = System.getenv("ossUser")
                    password = System.getenv("ossToken")
                }
            }
        }
    }
}
a

Artyom Degtyarev [JB]

12/08/2020, 7:05 AM
Hello, @Javier! As far as I can see, this Gradle script contains no
kotlin("multiplatform")
plugin applied. Could you please clarify what do you mean by multiplatform here, or, if possible, share a project to reproduce the problem? You can also do it using kotl.in/issue. It is also a correct place to contribute a feature request.
j

Javier

12/08/2020, 10:32 AM
Because it is a precompiled plugin in buildSrc, later I apply this precompiled plugin and the Multiplatform one