本文介绍了库上传 - 但gradle这个下载只是POM和aar.asc从Maven的中央的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的build.gradle uploadArchives方法内我上传我的图书馆

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:[email protected]:atooma/atooma-android-sdk.git'
                    developerConnection 'scm:[email protected]: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 '[email protected]'
                    }
                }
            }
        }
    }
}

我试过pagkagingAAR'和'罐子'为好。
在由关系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的工作室下载(编译'com.atooma:atooma-Android的SDK 1.2.1')是只下载aar.asc和POM文件。在POM文件我见
aar.asc
我不明白为什么...:(

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 seeaar.ascand I can't understand why... :(

显然,我设置编译com.atooma:atooma-Android的SDK:1.2.1@aar它的工作原理

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

推荐答案

据我所知您正确无所不为。如果你看一下
的无论是POM和AAR文件的存在。问题在于Android的工作室还没有正确地支持这样的AAR文件。我建议以便将错误了Android SDK团队和Android Studio项目作为Jetbrains的。

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.

这篇关于库上传 - 但gradle这个下载只是POM和aar.asc从Maven的中央的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 06:11