6

I am trying to publish my Android library to JCenter using Bintray's web site.

I have created a Maven styled zip file which includes all the needed artifacts: aar, sources, javadocs and pom file using the following blog post:

http://blog.blundell-apps.com/locally-release-an-android-library-for-jcenter-or-maven-central-inclusion/

Everything seems to be in place inside the created zip file but still I get an error when trying to link my package to JCenter:

Add a POM file to the latest version of your package

I am not sure what's wrong, since a pom is inside..

Any ideas what might be wrong?

UPDATE:

This is the content of the zip file:

com
└───foxxymobile
    └───wearmock
        └───wear-mock
            │   maven-metadata.xml
            │   maven-metadata.xml.md5
            │   maven-metadata.xml.sha1
            │
            └───0.1.0
                    wear-mock-0.1.0-javadoc.jar
                    wear-mock-0.1.0-javadoc.jar.md5
                    wear-mock-0.1.0-javadoc.jar.sha1
                    wear-mock-0.1.0-sources.jar
                    wear-mock-0.1.0-sources.jar.md5
                    wear-mock-0.1.0-sources.jar.sha1
                    wear-mock-0.1.0.aar
                    wear-mock-0.1.0.aar.md5
                    wear-mock-0.1.0.aar.sha1
                    wear-mock-0.1.0.pom
                    wear-mock-0.1.0.pom.md5
                    wear-mock-0.1.0.pom.sha1

And this is the POM file:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.foxxymobile.wearmock</groupId>
  <artifactId>wear-mock</artifactId>
  <version>0.1.0</version>
  <packaging>aar</packaging>
  <dependencies>
    <dependency>
      <groupId>com.android.support</groupId>
      <artifactId>appcompat-v7</artifactId>
      <version>21.0.3</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>

AS you can see, the pom is located inside the zip. This is how the script created it.

Ran
  • 1,089
  • 1
  • 12
  • 30

2 Answers2

7

The cause of this issue was that all required artifacts were uploaded as a zip archive which was not extracted. For this reason Bintray could not find the required POM fie.
When manually uploading content to Bintray, you can upload an archive and choose to extract it by checking the "Explode this archive" checkbox. This checkbox is unchecked by default.

Dror Bereznitsky
  • 20,048
  • 3
  • 48
  • 57
1

This is how I solved it:

I manually upload 2 files to Bintray, in the following name format:

[library name]-[version].[type]

for example:

my-library-name-0.0.3.pom 
my-library-name-0.0.3.aar

The file my-library-name-0.0.3.pom is a copy of the generatd file [lib project folder]\build\poms\pom-default.xml, which contains a list of dependencies and stuff.

Important: When I upload my-library-name-0.0.3.pom, the system suggested to put it in a specific path - you nedd to put both files there.

After publishing the files, you should see in the package page "Maven build settings (ver: 0.0.3)" and the maven/gradle inport details.

Asaf Pinhassi
  • 15,177
  • 12
  • 106
  • 130