How to publish android library in Jfrog bintray?

I am working on developing an Android library, I have already finished working with the library and created the aar and jar file, but when I try to publish to a binary, I get one error message.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mylittlelibrary:bintrayUpload'.
> Could not create package 'abcd/maven/helloaar.example.com.mylittlelibrary': HTTP/1.1 404 Not Found [message:Repo 'maven' was not found]

* Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.391 secs
Could not create package 'abcd/maven/helloaar.example.com.mylittlelibrary': HTTP/1.1 404 Not    Found [message:Repo 'maven' was not found]
2:41:59 AM: External task execution finished 'bintrayUpload'.

build.gradle

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

repositories {
   mavenCentral()
}

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"

defaultConfig {
    minSdkVersion 17
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0-beta1'
}

 group = 'helloaar.example.com.mylittlelibrary'
 version = '1.0.2'

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

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

 task generateJavaDocsJar(type: Jar) {
     from generateJavaDocs.destinationDir
     classifier 'javadoc'
 }
 generateJavaDocsJar.dependsOn generateJavaDocs

bintray {
    user = 'abcd'
    key = '1234567890fghgfhffjfgjfjfjrtyjtkjg'
    pkg {
       repo = 'maven'
       name = 'helloaar.example.com.mylittlelibrary'

    version {
        name = '1.0.2'
        desc = 'My test upload'
        released  = new Date()
        vcsTag = '1.0.2'
    }

    licenses = ['Apache-2.0']
    vcsUrl = ''
    websiteUrl = ''
}
configurations = ['archives']
}

artifacts {
   archives generateJavaDocsJar
   archives generateSourcesJar
}

enter image description here

Please kindly review my script and offer me some solution.

+4
source share
2 answers

Before publishing to Bintray, you must have a stable build of your code. The hierarchy on Bintray is as follows: User → Repo → package → version → artifact means that the repo should be higher than the package in this hierarchy.

The following lines in gradle.build are probably the main cause of the error:

pkg {
    repo = 'maven'
    name = 'helloaar.example.com.mylittlelibrary'
}

.

maven , maven, Maven Build . Maven Bintray.

:

HTTP/1.1 404 Not Found [message:Repo 'maven' was not found] 

, Bintray, maven. Bintray, .

Bintray support, Bintray JFrog, Bintray, Artifactory, Mission control Xray.

+2
pkg {
    repo = 'maven'
    name = 'helloaar.example.com.mylittlelibrary'

    version {
        name = '1.0.2'
        desc = 'My test upload'
        released  = new Date()
        vcsTag = '1.0.2'
    }

Could not create package 'abcd/maven/helloaar.example.com.mylittlelibrary': HTTP/1.1 404 Not    Found [message:Repo 'maven' was not found]
2:41:59 AM: External task execution finished 'bintrayUpload'.

'ABCD/Maven/helloaar.example.com.mylittlelibrary

  • abcd: bintray
  • maven: pkg {repo = 'maven'}, , , 'abcd/android-lib/helloaar.example.com.mylittlelibrary' repo = 'android-lib'
  • helloaar.example.com.mylittlelibrary: pkg {name = 'helloaar.example.com.mylittlelibrary'

-

  • : bintray,
  • second: ,
  • : pkg repo = ', ' build.gradle
  • last: .

,

0

Source: https://habr.com/ru/post/1654069/


All Articles