简体   繁体   English

库已上传-但是gradle仅从Maven Central下载pom和aar.asc

[英]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 这是我上传库中的build.gradle uploadArchives方法

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. 我也尝试过拼写“ aar”和“ jar”。 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 在来自“联系”的声纳类型站点中,我可以看到aar和此处的pom 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 说a

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. 但是,当我从Android Studio下载它(编译为com.atooma:atooma-android-sdk:1.2.1)时,它仅下载aar.asc和pom文件。 In pom file I see aar.asc and I can't understand why... :( 在pom文件中,我看到aar.asc,但我不明白为什么... :(

Obviously it I set compile 'com.atooma:atooma-android-sdk:1.2.1@aar' it works 显然我设置了编译'com.atooma:atooma-android-sdk:1.2.1@aar'它可以正常工作

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. 如果您查看https://oss.sonatype.org/content/repositories/releases/com/atooma/atooma-android-sdk/1.2.1/ ,则pom和aar文件都在其中。 The problem lies with Android Studio does not yet support aar files like that properly. 问题在于Android Studio尚未正确支持此类文件。 I would suggest to file a bug with the Android SDK team and the Android Studio project as Jetbrains. 我建议以Jetbrains的身份向Android SDK团队和Android Studio项目提交错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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