Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publishing android library to jcenter error - Add a POM file to the latest version of your package

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.

like image 498
Ran Avatar asked Jan 06 '15 07:01

Ran


People also ask

How to add new version of a package in jcenter?

Now, click on the Package name link and you will be directed to the package details page. Here, you can see lots of details about your package and options to add new versions and whether your package is available on jCenter etc. I have highlighted the package name and the maven link in the image. We will discuss maven link later.

How long will jcenter allow downloads of existing artifacts?

According to the announcement , JCenter will allow downloads of existing artifacts indefinitely. Developers who publish artifacts on JCenter should migrate their packages to a new host, such as Maven Central. Developers who use dependencies from JCenter will need to find the new location of updated versions of those dependencies.

What does it mean to publish an Android library?

In addition to publishing Android applications for users, you can publish libraries that developers can incorporate in their apps. When you publish an Android library you do four main tasks: You prepare the library for release.

What is the latest jcenter update?

JCenter service update JFrog, the company that maintains the JCenter artifact repository used by many Android projects, made JCenter a read-only repository on March 31st, 2021. According to the announcement, JCenter will allow downloads of existing artifacts indefinitely.


1 Answers

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.

like image 116
Dror Bereznitsky Avatar answered Sep 22 '22 16:09

Dror Bereznitsky