Arjan van Wieringen
01/20/2023, 2:42 PMmaven-publish
setup for a Kotlin Multiplatform project, but I am getting these notices in the logging when running the publish
task:
> Task :ui:base:publishKotlinMultiplatformPublicationToMavenRepository
Multiple publications with coordinates 'nl.avwie:ui-base:1.0.0-SNAPSHOT' are published to repository 'maven'. The publications 'js' in project ':ui:base' and 'kotlinMultiplatform' in project ':ui:base' will overwrite each other!
Multiple publications with coordinates 'nl.avwie:ui-base:1.0.0-SNAPSHOT' are published to repository 'maven'. The publications 'jvm' in project ':ui:base' and 'kotlinMultiplatform' in project ':ui:base' will overwrite each other!
How can I remove these notices?
I am using:
publishing {
repositories {
maven {
url = uri("<https://maven.pkg.jetbrains.space/avwie/p/avwie/maven>")
credentials {
...
}
}
}
publications.withType<MavenPublication> {
artifactId = "ui-base"
}
}
tapchicoma
01/20/2023, 2:50 PMpublications.withType<MavenPublication> {
artifactId = "ui-base"
}
Try to remove it and check if publication will not have errorshfhbd
01/20/2023, 2:51 PMArjan van Wieringen
01/20/2023, 2:53 PMui/base
and ui/compose
, so without the artifact id the naming is just base
and ui
. But I see it works now. How can I make sure the names are still ui-base-js
and not base-js
?hfhbd
01/20/2023, 2:56 PMname=ui-base
Arjan van Wieringen
01/20/2023, 2:58 PMArjan van Wieringen
01/20/2023, 2:59 PMArjan van Wieringen
01/20/2023, 3:00 PMproject(":foo").name = "foofoo"
in the main file.Vampire
01/20/2023, 3:07 PMinclude("ui-foo")
and then project("ui-foo").projectDirectory = file("ui/foo")
or similar in the settings script.Arjan van Wieringen
01/20/2023, 3:08 PMval subProjects = listOf(
":ui:base",
":ui:compose"
).also(::include)
subProjects.forEach { path ->
project(path).name = path.trim(':').replace(":", "-")
}
This doesn't work:
include("ui-base")
project("ui-base").projectDir = file("ui/base")
This does:
include(":ui-base")
project(":ui-base").projectDir = file("ui/base")
Vampire
01/20/2023, 3:13 PMprojectDir
, was not sure whether setting the name properly works as expected, especially as I understood you should set it in the build script, not the settings script and there it would most probably be problematic.Arjan van Wieringen
01/20/2023, 3:14 PMVampire
01/20/2023, 3:14 PMinclude(":ui:base")
you are creating two projects, the project ui
and the project base
below it.Vampire
01/20/2023, 3:15 PMui-base
and set its project directoryArjan van Wieringen
01/20/2023, 3:16 PMui
is also a project. It makes sense for me that i have root -> ui -> base
but the artifacts should just be ui-base
Vampire
01/20/2023, 3:17 PMArjan van Wieringen
01/20/2023, 3:17 PM