我试图使用bintray发布我的android库,但最终在bintray maven stringx和stringx-android-sdk中出现了两个单独的工件:
https://dl.bintray.com/klimaszewski/stringx/io/stringx/
来源和所有内容都放在这里:
https://dl.bintray.com/klimaszewski/stringx/io/stringx/stringx/1.0.2/

POM文件放置在正确的工件中:
https://dl.bintray.com/klimaszewski/stringx/io/stringx/stringx-android-sdk/1.0.2/

我的Bintray回购是:stringx和库名称:stringx-android-sdk

该库的原因无法在我的项目中解决。怎么了
build.gradle

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }

    dependencies {
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
    }
}
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

ext {
    bintrayRepo = 'stringx'
    bintrayName = 'stringx-android-sdk'

    publishedGroupId = 'io.stringx'
    libraryName = 'StringX-SDK'
    artifact = 'stringx-android-sdk'

    libraryDescription = 'Automatic app Translation for Android'

    siteUrl = 'https://www.stringx.io'
    gitUrl = 'https://github.com/SzyQ/stringx-android-sdk'

    developerId = 'klimaszewski'
    developerName = 'Szymon Klimaszewski'
    developerEmail = '[email protected]'

    licenseName = 'The Apache Software License, Version 2.0'
    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    allLicenses = ["Apache-2.0"]
    versionMajor = 1
    versionMinor = 0
    versionHotFix = 2

    libraryVersion = buildVersionName()
}

android {
    compileSdkVersion 27
    buildToolsVersion "26.0.2"
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 27
        versionCode buildVersionCode()
        versionName buildVersionName()
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:support-annotations:27.0.0'
}

def buildVersionName() {
    String versionName
    if (versionHotFix == null || versionHotFix == 0) {
        versionName = versionMajor + "." + versionMinor
    } else {
        versionName = versionMajor + "." + versionMinor + "." + versionHotFix
    }
    println "Version name: " + versionName
    return versionName
}

def buildVersionCode() {
    Integer versionCode
    if (versionHotFix == null || versionHotFix == 0) {
        versionCode = versionMajor * 10000 + versionMinor * 100
    } else {
        versionCode = versionMajor * 10000 + versionMinor * 100 + versionHotFix
    }
    println "Version code: " + versionCode
    return versionCode
}

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

最佳答案

Android模块名称必须与bintray包“ stringx-android-sdk”匹配。

所以我不得不在settings.gradle中更改模块

include ':stringx-android-sdk'
project(":stringx-android-sdk").projectDir = file("../../stringx")

07-26 09:39