Загрузка библиотеки Android в Bintray — параметр userOrg игнорируется

Я пытаюсь загрузить библиотеку Android в Bintray, используя это руководство: https://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en

Все работает нормально, пока я не пытаюсь запустить bintrayUpload, когда получаю следующую ошибку:

Не удалось выполнить задачу ':MAS:bintrayUpload'.

Не удалось создать пакет 'user/maven/my-repo': HTTP/1.1 404 Not Found [сообщение: Repo 'maven' не найден]

Я думаю, проблема в том, что репозиторий принадлежит организации на Bintray. Но ищет его под пользователем. т.е. user/maven/my-repo должен быть организация/maven/my-repo.

Мои local.properties выглядят так:

...    
bintray.userOrg=organisation
bintray.user=user
bintray.apikey=key
bintray.gpg.password=password
...

Мой build.gradle для библиотечного модуля выглядит так:

/*
 * Copyright (c) 2016 CA. All rights reserved.
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 *
 */

//noinspection GradleCompatible
// In order to build messaging using gradle 2 environment variables must be exportedd
// 1. prefix - this is the aar prefix, for example 'android'
// 2. versionName - this is the v.r.m formatted version name as used in the AndroidManifest.xml.
// For example, 1.1.0

plugins {
    id "com.jfrog.bintray" version "1.7"
    id "com.github.dcendents.android-maven" version "1.5"
}

apply plugin: 'com.android.library'
apply plugin: 'maven-publish'



ext {
    bintrayRepo = 'maven'
    bintrayName = 'mobile-app-services'

    publishedGroupId = 'com.ca'
    libraryName = 'MobileAppServices'
    artifact = 'mobile-app-services'

    libraryDescription = 'The Android Mobile SDK gives developers simple and secure access to the services of CA Mobile API Gateway and CA Mobile App Services. '

    siteUrl = 'https://github.com/CAAPIM/Android-MAS-SDK'
    gitUrl = 'https://github.com/CAAPIM/Android-MAS-SDK.git'

    libraryVersion = '3.2.00'

    developerId = 'devId'
    developerName = 'Full Name'
    developerEmail = '[email protected]'

    licenseName = 'The MIT License (MIT)'
    licenseUrl = 'license.com'
    allLicenses = ["MIT"]
}

println '------> Executing mas library build.gradle'
repositories {
    mavenCentral()
    flatDir {
        dirs 'libs'
    }
}
android {
    compileSdkVersion 24
    buildToolsVersion '24.0.2'
    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 24
        versionCode 12
        versionName "1.2"
    }

    lintOptions {
        abortOnError false
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

task javadoc(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    println "Source: $source"
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    println "Classpath: $source"
    options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
    destinationDir = file("../docs/mas_javadoc/")
    failOnError false

    include '**/*MAS*.java'
    include '**/Device.java'
    include '**/ScimUser.java'

    exclude '**/MASTransformable.java'
    exclude '**/MASResultReceiver.java'
    exclude '**/MASWebServiceClient.java'
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile project(':MAG')
}

apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'

person CSE    schedule 06.10.2016    source источник


Ответы (1)


При загрузке контекста в репозиторий, принадлежащий организации, вы должны соблюдать соглашение Bintray REST API, используя следующий путь: OrganizationName/RepoName, а не UserName/RepoName.

Я не знаю, для чего используется слово «мавен» в пути, который вы написали выше.

В случае, указанном выше, могут быть полезны следующие ссылки Bintray REST API:

В приведенной выше ситуации :subject относится к названию организации (а не к имени пользователя). В любом случае, когда репозиторий находится под пользователем, :subject ссылается на имя пользователя.

Дополнительные сведения см. в полной документации по REST API Bintray.

Другой способ загрузить файл — использовать интерфейс Bintray, который может быть более наглядным для понимания структуры ваших репозиториев, пакетов , версии и артефакты.

person Rotem    schedule 07.10.2016