Hello! I was checking the docs, how to publish mul...
# multiplatform
d
Hello! I was checking the docs, how to publish multiplatform library to maven, using maven-publish, I couldn’t understand the next statement: “To avoid duplicate publications of modules that can be built on several platforms (like JVM and JS), configure the publishing tasks for these modules to run conditionally.” What does it mean?How duplications are created?How to manage it? What does it mena “module that can be built on several platforms”? Documentation is located here: https://kotlinlang.org/docs/multiplatform-publish-lib.html#avoid-duplicate-publications Thanks
r
Some publications can only be build on specific platforms. For example you’ll need to build the iOS publications on macOS. However since macOS machines are expensive you might want to use a linux machine to build the JVM publications. In case you do that you’ll need to make sure that you don’t publish the JVM publication on the macOS machine as that would result in duplicates.
👏 2
thank you color 1
d
It’s great explanation, thank you very much!
p
Maven Central will not take the upload if the same artifact id already exists anyway. But it is a sane practice to check for the duplicate in case. I have seen some Nexus configuration in companies that allow you to override existing artifacts and you don't want that.
d
Thank you