vanniktech / gradle-maven-publish-plugin

A Gradle plugin that publishes your Android and Kotlin libraries, including sources and javadoc, to Maven Central or any other Nexus instance.
https://vanniktech.github.io/gradle-maven-publish-plugin
Apache License 2.0
1.31k stars 119 forks source link

Having trouble pulling in sources published with this plugin #371

Closed mattinger closed 2 years ago

mattinger commented 2 years ago

we are publishing android libraries using this plugin with a very basic configuration

plugins {
    id("com.vanniktech.maven.publish")
}

mavenPublish {
    sonatypeHost = null
}

System.setProperty("org.gradle.internal.publish.checksums.insecure", "true")
publishing {
    repositories {
        maven {
            url = XXXX
            credentials {
                username = XXXX
                password = XXXX
            }
        }
    }
}

And i can see all the aar and source files in my local maven repo when i do a publishToMavenLocal.

However, when i bring the dependency into android studio, i'm getting an error with it trying to download the sources:

* What went wrong:
Execution failed for task ':xle-onboarding:DownloadSources'.
> Supplied String module notation 'com.xfinity.dh:compose-templates:0.20.0-SNAPSHOT:debug@aar:sources' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.

This problem appeared for us only once we migrated to using this plugin from directly using the maven-publish plugin. Presumably because we weren't putting any specific classifiers on the sources since we were only publishing the "debug" version. Now that we publish debug and release using this plugin it's choking getting the sources.

gabrielittner commented 2 years ago

This is a bug in Android Studio which can't properly deal with published multi variant libraries https://issuetracker.google.com/issues/197636221 I will change the default for this plugin to only publishing the release variant again until this issue is fixed

gabrielittner commented 2 years ago

0.21.0 was published and will be available within the next hour