简体   繁体   English

在私有BitBucket存储库上部署AAR

[英]Deploying AAR on private BitBucket Repository

I am trying to deploy artifacts to a private bitbucket repository. 我正在尝试将工件部署到私有bitbucket存储库。 I was following this tutorial https://medium.com/@Mul0w/publish-with-gradle-on-bitbucket-1463236dc460 and also some other stack posts and managed to get to a decent point. 我正在关注本教程https://medium.com/@Mul0w/publish-with-gradle-on-bitbucket-1463236dc460以及其他一些堆栈文章,并设法达到了一个不错的水平。 However I am stuck post that. 但是,我被困在那。

I have added the following uploadArchives task to gradle. 我已将以下uploadArchives任务添加至gradle。

uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
    pom.groupId = GROUPID
    pom.artifactId = ARTIFACTID
    pom.version = VERSION
    configuration = configurations.deployerJar
    repository(url: "git:master://git@bitbucket.org:<Team Name>/<Repo Name>.git"){
        authentication(userName: <username>, password: <password>)
    }
    pom.project {
        name POM_NAME
        packaging POM_PACKAGING
        description POM_DESCRIPTION
        url POM_URL
        scm {
            url POM_SCM_URL
            connection POM_SCM_CONNECTION
            developerConnection POM_SCM_DEV_CONNECTION
        }
        licenses {
            license {
                name POM_LICENCE_NAME
                url POM_LICENCE_URL
                distribution POM_LICENCE_DIST
            }
        }
        developers {
            developer {
                id DEVELOPER_ID
                name DEVELOPER_NAME
                email DEVELOPER_EMAIL
            }
        }
    }
}

} }

When I run the command ./gradlew assembleRelease :module:uploadArchives --info 当我运行命令./gradlew assembleRelease:module:uploadArchives --info

I get the following error 我收到以下错误

Failed to deploy artifacts: Could not transfer artifact "<group id>":"<artifact id>":aar:"<version number>" from/to remote (git:master://git@bitbucket.org:<team name>/<repo name>.git): Unable to put file

Why is gradle unable to transfer the artifact to the master branch of my repository? 为什么gradle无法将工件转移到存储库的master分支? Any help would be highly appreciated. 任何帮助将不胜感激。

The page you linked is stating that the branch should be releases , not master . 您链接的页面指出该分支应该是releases ,而不是master As this way it works for me, I suggest keeping to it. 以这种方式对我有用,我建议坚持下去。 So it should look like: 所以它应该看起来像:

repository(url: "git:releases://git@bitbucket.org:<Team Name>/<Repo Name>.git")

Also you are trying to put into this Gradle script authentication data. 另外,您正在尝试将此Gradle脚本身份验证数据放入其中。 I don't know if it would work, as I'm using SSH key for bitbucket account for git authentication. 我不知道它是否行得通,因为我将SSH密钥用于git身份验证的bitbucket帐户。

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

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