Closed westnordost closed 2 years ago
Running ./gradlew publishToLocalMaven
I get these warnings:
> Task :library:publishKotlinMultiplatformPublicationToMavenLocal
Multiple publications with coordinates 'de.westnordost:osm-legal-default-speeds:1.1' are published to repository 'mavenLocal'. The publications 'js' in project ':library' and 'kotlinMultiplatform' in project ':library' will overwrite each other!
> Task :library:publishNativePublicationToMavenLocal
Multiple publications with coordinates 'de.westnordost:osm-legal-default-speeds:1.1' are published to repository 'mavenLocal'. The publications 'js' in project ':library' and 'native' in project ':library' will overwrite each other!
Multiple publications with coordinates 'de.westnordost:osm-legal-default-speeds:1.1' are published to repository 'mavenLocal'. The publications 'kotlinMultiplatform' in project ':library' and 'native' in project ':library' will overwrite each other!
> Task :library:publishJvmPublicationToMavenLocal
Multiple publications with coordinates 'de.westnordost:osm-legal-default-speeds:1.1' are published to repository 'mavenLocal'. The publications 'js' in project ':library' and 'jvm' in project ':library' will overwrite each other!
Multiple publications with coordinates 'de.westnordost:osm-legal-default-speeds:1.1' are published to repository 'mavenLocal'. The publications 'jvm' in project ':library' and 'kotlinMultiplatform' in project ':library' will overwrite each other!
Multiple publications with coordinates 'de.westnordost:osm-legal-default-speeds:1.1' are published to repository 'mavenLocal'. The publications 'jvm' in project ':library' and 'native' in project ':library' will overwrite each other!
When I add the $name
to the artifactId like this (in library/build.gradle.kts
)
publishing {
publications {
withType<MavenPublication> {
artifactId = "osm-legal-default-speeds-$name"
the warnings are gone and I get separate artifacts for the different targets.
Hm, probably. I noticed that I ignored this part of the tutorial for "publishing multiplatform libraries":
https://kotlinlang.org/docs/multiplatform-publish-lib.html#avoid-duplicate-publications
, mainly because I didn't and still don't understand what the snippet they gave there does.
I saw this too and did not understand it either. But the solution I suggested is pretty clear(?!). It simply appends the target name so there are separate publications/artifacts for each platform. And isn't this exactly what we want? For example when developing on the JVM I do not want the artifact to contain JS or native stuff?
Yeah. Would you like to create a PR?
I am still in Florence and I think I am not set up here to publish things on maven central, so it will be a week or so (anyway) till a new publication can appear on maven central.
from https://github.com/graphhopper/graphhopper/issues/2392
To reproduce, it should be enough to create a new Java or Kotlin project and try to include this library (unconfirmed).
This error doesn't ring a bell, but some keywords (
nativeApiElements-published
etc.) may be useful to search for details on this error.