2015-10-18 14 views
6

Voglio caricare la mia libreria su jecenter. Ho creato un account bintray ecc. & seguito da tutti i passaggi menzionati qui.Esecuzione non riuscita per l'attività ': bintrayUpload'.

Ho fatto sotto le modifiche nel modulo di libreria & modulo di domanda.

// Biblioteca build.gradle

apply plugin: 'com.android.library' 
 
apply plugin: 'com.github.dcendents.android-maven' 
 
apply plugin: 'com.jfrog.bintray' 
 

 
android { 
 
    compileSdkVersion 22 
 
    buildToolsVersion "22.0.1" 
 
    resourcePrefix "winchance" 
 

 
    version = "1.0.0" 
 

 
    defaultConfig { 
 
     minSdkVersion 15 
 
     targetSdkVersion 22 
 
     versionCode 1 
 
     versionName version 
 
    } 
 
    buildTypes { 
 
     release { 
 
      minifyEnabled false 
 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
 
     } 
 
    } 
 

 
    lintOptions { 
 
     abortOnError false 
 
    } 
 
} 
 

 
dependencies { 
 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
 
    testCompile 'junit:junit:4.12' 
 
    compile 'com.android.support:appcompat-v7:22.2.1' 
 
    compile 'com.google.code.gson:gson:2.2.4' 
 
} 
 

 
def siteUrl = "https://github.com/lubeast/WinchanceHttpUtil" 
 
def gitUrl = "https://github.com/lubeast/WinchanceHttpUtil.git" 
 

 
group = "com.winchance.library" 
 

 
install { 
 
    repositories.mavenInstaller { 
 
     // This generates POM.xml with proper paramters 
 
     pom { 
 
      project { 
 
       packaging 'aar' 
 

 
       name 'Net Utils for Winchance' 
 
       url siteUrl 
 

 
       licenses { 
 
        license { 
 
         name 'The Apache Software License, Version 2.0' 
 
         url 'http://www.apache.org/licenses/LICENSE-2.0.txt' 
 
        } 
 
       } 
 
       developers { 
 
        developer { 
 
         id 'lumeng' 
 
         name 'lumeng' 
 
         email '[email protected]' 
 
        } 
 
       } 
 

 
       scm { 
 
        connection gitUrl 
 
        developerConnection gitUrl 
 
        url siteUrl 
 
       } 
 
      } 
 
     } 
 
    } 
 
} 
 

 
task sourcesJar(type: Jar) { 
 
    from android.sourceSets.main.java.srcDirs 
 
    classifier = 'sources' 
 
} 
 

 
task javadoc(type: Javadoc) { 
 
    source = android.sourceSets.main.java.srcDirs 
 
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 
 
} 
 

 
task javadocJar(type: Jar, dependsOn: javadoc) { 
 
    classifier = 'javadoc' 
 
    from javadoc.destinationDir 
 
} 
 

 
artifacts { 
 
    archives javadocJar 
 
    archives sourcesJar 
 
} 
 

 
Properties properties = new Properties() 
 
properties.load(project.rootProject.file('local.properties').newDataInputStream()) 
 

 

 
bintray { 
 
    user = properties.getProperty("bintray.user") 
 
    key = properties.getProperty("bintray.apikey") 
 

 
    configurations = ['archives'] 
 

 
    pkg { 
 
     repo = "maven" 
 
     name = "winchance-http-util" 
 
     websiteUrl = siteUrl 
 
     vcsUrl = gitUrl 
 
     licenses = ["Apache-2.0"] 
 
     publish = true 
 
    } 
 
}

// primo livello build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules. 
 

 
buildscript { 
 
    repositories { 
 
     jcenter() 
 
    } 
 
    dependencies { 
 
     classpath 'com.android.tools.build:gradle:1.3.0' 
 
     classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' 
 
     classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' 
 

 
     // NOTE: Do not place your application dependencies here; they belong 
 
     // in the individual module build.gradle files 
 
    } 
 
} 
 

 
allprojects { 
 
    repositories { 
 
     jcenter() 
 
    } 
 
}

Quando ho superato gradlew bintrayUpload mostra

FAILURE: Build fallito con un'eccezione.

  • Cosa è andato storto: Esecuzione non riuscita per l'attività ': library: bintrayUpload'.

    Impossibile creare il pacchetto 'Lumeng/Maven/WinchanceHttpUtil': HTTP/1.1 401 non autorizzato [messaggio: Questa risorsa richiede l'autenticazione]

Please help me, thx

risposta

2

ero anche di fronte allo stesso problema. Per qualche motivo, non è in grado di ottenere la chiave bintray.user & dal file delle proprietà. Prova a codificare l'utente e la chiave e poi riprova.

-2

Rimuovere apply plugin: 'com.jfrog.bintray' e dovrebbe funzionare

Problemi correlati