5

I am trying to publish the library to JCenter with Bintray, according to this article: https://medium.com/@anitaa_1990/6-easy-steps-to-upload-your-android-library-to-bintray-jcenter-59e6030c8890.

I successfully added the library to Bintray, but when I click on "Add to JCenter" button and send compose message - I am getting an error:

Failed to send a message: Package should include sources as part of the package.

Please, tell me what am I doing wrong?

Milad Bahmanabadi
  • 946
  • 11
  • 27
Andrii Chernysh
  • 365
  • 3
  • 13

2 Answers2

4

Your Bintray Maven Package doesn't contain the sources, only .aar and the .pom. The in the blog post isn't linked to JCenter, see blog's package here.

Bintray's wiki states that you have to include the sources.

I would use this blog post or this one, where the packages are actually linked to JCenter.

artem
  • 16,382
  • 34
  • 113
  • 189
Royg
  • 1,665
  • 1
  • 13
  • 20
0

For developers who reach here today, make sure your configuration file has artifact(sourcesJar.get()) in publishing{} like these lines below (not complete build.gradle.kts).

val sourcesJar by tasks.registering(Jar::class) {
    classifier = "sources"
    from(sourceSets.main.get().allSource)
}

publishing {
  publications {
    create<MavenPublication>("default") {
      from(components["java"])
        artifact(dokkaJar)
    }
  }

  publications.invoke {
    publicationName(MavenPublication::class) {
      artifactId = artifactID
      artifact(sourcesJar.get()) // This line
    }
  }
}