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

hallvard

11/20/2019, 7:45 PM
@JoakimForslund: Using the
maven-publish
plugin, I do this, which works well for me:
Copy code
publishing {
    publications {
        maven(MavenPublication) {
            pom {
                name = 'projectname'
                description = 'Whatever ...'
            }
            artifactId project.name
            groupId project.group
            version project.version

            // Without the following line, these gradle build scripts publish no jar to maven
            // We have not succeeded in finding out why (as of May 2019)
            from components.java
        }
    }
    repositories {
        maven {
            def releasesRepoUrl = "(url here)"
            def snapshotsRepoUrl = "(url here)"
            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
            credentials {
                username mavenUser
                password mavenPassword
            }
        }
    }
}
j

JoakimForslund

11/20/2019, 7:47 PM
Yeah, it was what I had at the start, was hoping it could be moved into the android target entirely because thats the only thing I'm using it for
So it looks like currently, you can not add a remote target the way I looked at it
You can set up the pom relevant configurations inside the android target, but it seems like the repositories section still needs to live inside the publishing {} scope
3 Views