简体   繁体   中英

Library uploaded - But gradle download only pom and aar.asc from Maven Central

This is my build.gradle uploadArchives method within I upload my library

version = "1.2.1"
group = "com.atooma"
archivesBaseName = "atooma-android-sdk"

signing {
    sign configurations.archives
}

uploadArchives {
    repositories {
        mavenDeployer {
            beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

            repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
                authentication(userName: sonatypeUsername, password: sonatypePassword)
            }

            snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
                authentication(userName: sonatypeUsername, password: sonatypePassword)
            }

            pom.project {
                name 'Atooma Android SDK'
                packaging 'aar'
                // optionally artifactId can be defined here
                description 'Atooma Software Development Kit allows you to write your own modules for Atooma app'
                url 'https://github.com/atooma/atooma-android-sdk'

                scm {
                    url 'https://github.com/atooma/atooma-android-sdk.git'
                    connection 'scm:git@github.com:atooma/atooma-android-sdk.git'
                    developerConnection 'scm:git@github.com:atooma/atooma-android-sdk.git'
                }

                licenses {
                    license {
                        name 'LGPL V3'
                        url 'https://www.gnu.org/licenses/lgpl.html'
                    }
                }

                developers {
                    developer {
                        id 'monossido'
                        name 'Lorenzo Braghetto'
                        email 'l.braghetto@atooma.com'
                    }
                }
            }
        }
    }
}

I've tried pagkaging 'aar' and 'jar' as well. In sonatype site from "nexus" i can see aar And the pom here https://oss.sonatype.org/service/local/repositories/releases/content/com/atooma/atooma-android-sdk/1.2.1/atooma-android-sdk-1.2.1.pom

says aar

But when I download it from Android Studio (compile 'com.atooma:atooma-android-sdk:1.2.1') it download only the aar.asc and pom files. In pom file I see aar.asc and I can't understand why... :(

Obviously it I set compile 'com.atooma:atooma-android-sdk:1.2.1@aar' it works

As far as I know you are doing everything correctly. If you look at https://oss.sonatype.org/content/repositories/releases/com/atooma/atooma-android-sdk/1.2.1/ both the pom and the aar file are there. The problem lies with Android Studio does not yet support aar files like that properly. I would suggest to file a bug with the Android SDK team and the Android Studio project as Jetbrains.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM