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

spierce7

08/27/2019, 8:53 PM
Has anyone successfully pushed a multiplatform project to a maven repo in artifactory?
d

darkmoon_uk

08/27/2019, 9:06 PM
Not yet, but I'm currently trying.
s

spierce7

08/27/2019, 9:11 PM
I’m trying as well… I’m getting 405's and I’ve tried just about everything
s

Sebastian Sellmair [JB]

08/27/2019, 9:32 PM
https://github.com/sellmair/kompass This project pushes to bintray, if this would help in any way 🤔
s

spierce7

08/27/2019, 9:43 PM
I can successfully push to bintray as well with my OSP here: https://github.com/ScottPierce/kotlin-html
I’m following the same method for artifactory and it’s failing wit ha 405
s

Sebastian Sellmair [JB]

08/27/2019, 9:43 PM
You are pushing the .module files, right?
s

spierce7

08/27/2019, 9:44 PM
so the great thing about the kotlin-multiplatform plugin is it directly integrates with the maven-publish gradle plugin
and it takes care of everything for you… All you have to do is add the repository
and then you call that function from your project
and then a gradle task to publish is added to your module. It’s super simple
d

darkmoon_uk

08/28/2019, 7:01 AM
...so simple that it doesn't work.
c

corneil

08/28/2019, 7:37 AM
This project publishes to Nexus OSS using standard maven publish and same should work on Artifactory https://github.com/open-jumpco/kfsm
r

ribesg

08/28/2019, 8:03 AM
Well I had absolutely no problem setting it up with maven-publish, what’s your issue? (publishing 10+ MPP projects to a private artifactory)
d

darkmoon_uk

08/28/2019, 9:08 AM
I'm trying everything I can and keep getting back total garbage from Gradle:
Copy code
> Could not upload to '<https://api.bintray.com/content/chris-hatton/lib/multi-mvp/0.0.1/property(class> java/lang/String, map(provider(?)))/property(class java.lang.String, fixed(class java.lang.String, multi-mvp))/property(class java.lang.String, map(provider(?)))/property(class java.lang.String, fixed(class java.lang.String, multi-mvp))-property(class java.lang.String, map(provider(?))).pom': HTTP/1.1 400 Bad Request [message:Unable to upload files: Maven group, artifact or version defined in the pom file do not match the file path 'property(class java/lang/String, map(provider(?)))/property(class java.lang.String, fixed(class java.lang.String, multi-mvp))/property(class java.lang.String, map(provider(?)))/property(class java.lang.String, fixed(class java.lang.String, multi-mvp))-property(class java.lang.String, map(provider(?))).pom']
Like it's interpreting my entire Maven Artifact identifer as some stringified object output.
I've only added:
Copy code
id("maven-publish")
    id("com.jfrog.bintray") version "1.7"
...and then configured the
bintray
section and:
Copy code
publishing {
    publications {
        val kotlinMultiplatform by getting {
            (this as MavenPublication).artifactId = "multi-mvp"
        }
    }
}
No idea where it's getting all this other stuff from.
r

ribesg

08/28/2019, 9:33 AM
Well you’re using an additional plugin so I can’t help with that. Publishing to Artifactory doesn’t requiring anything more
m

msink

08/28/2019, 9:55 AM
AFAIK jfrog.bintray plugin is deprecated, same can be done by pure maven-publish See here: https://github.com/msink/kotlin-libui/commit/3ed479e5f26e6bc71f3e5b338752dbb5ee2160b4
r

ribesg

08/28/2019, 10:45 AM
Well I was afraid to ask what this plugin was doing more than maven-publish lol
s

spierce7

08/28/2019, 2:46 PM
@darkmoon_uk I talked to Gael Ribes. He’s doing the same approach that I am. Also FYI - the simple approach I’ve outlined above works with bintray.
I’m now going to focus on user management
Got it working.
d

darkmoon_uk

08/28/2019, 10:58 PM
Publish works! 🎉 Thanks for the pointers @spierce7 @ribesg @Sebastian Sellmair [JB], you saved my sanity 🙏 (There are too many examples out there still using the Bintray plugin without disclaimer)
2 Views