https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

edwinRNDR

05/06/2021, 9:19 PM
I have a multi module project in which some submodules are mpp and some are jvm only (with the classic non-mpp project layout). I noticed that the jvm submodules are not published by
publishJvmPublicationToMavenLocal
. I suspect this behavior is introduced in Kotlin 1.5.0. How do I get the jvm modules to publish, or is turning all submodules into mpp a better option?
r

rnett

05/06/2021, 9:22 PM
publishJvmPublicationToMavenLocal
is added my the multiplatform plugin to publish JVM only (it's generated per source set), the JVM only projects are published w/
publishToMavenLocal
. You can add
publishJvmPublicationToMavenLocal
to the JVM only projects and link up the tasks manually, or just use the top level
publishToMavenLocal
.
b

Big Chungus

05/06/2021, 9:29 PM
Did you add maven-publish plugin to jvm module?
j

Javier

05/06/2021, 10:04 PM
And you have to create a maven publication, jvm plugin is not doing it by default, kmp plugin does
e

edwinRNDR

05/07/2021, 2:26 PM
fair points, I do have maven-publish added and `publishToMavenLocal`doesn't publish the jvm submodules either
b

Big Chungus

05/07/2021, 2:29 PM
As Javier said, JVM plugin doesn't automatically configure your publications (as opposed to multiplatform plugin). Either use mpp plugin with jvm target only or configure maven publication manually