图书馆上传 - 但是从Maven Central只下载pom和aar.asc

时间:2015-01-16 11:59:18

标签: android maven gradle android-studio

这是我上传库中的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'
                    }
                }
            }
        }
    }
}

我已经尝试过偷看' aar'和' jar'同样。 来自" nexus"的sonatype网站我可以看到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

说aar

但是当我从Android Studio(编译' com.atooma:atooma-android-sdk:1.2.1')下载它时,它只下载aar.asc和pom文件。在pom文件中我看到了 aar.asc 我无法理解为什么...... :(

显然我设置编译' com.atooma:atooma-android-sdk:1.2.1@aar'它的工作原理

1 个答案:

答案 0 :(得分:0)

据我所知,你正在做的一切正确。如果你看看 https://oss.sonatype.org/content/repositories/releases/com/atooma/atooma-android-sdk/1.2.1/ pom和aar文件都在那里。问题在于Android Studio还不支持正确的aar文件。我建议将Android SDK团队和Android Studio项目的错误归档为Jetbrains。