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

2

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.

Temporal answered 6/1, 2015 at 7:27 Comment(7)
Can you please share the contents (file tree) of the zip file and the contents of the pom file?Embroil
Looks like you uploaded everything in one archive but did not explode itLandlubber
@Embroil I have added the zip file contents and the pom as per your request.Temporal
@drorb JCenter say they know how to accept a zip file and extract it on their side... it that true?Temporal
That's very true, if you ask nicely :) It's a checkbox in the UI and flag in REST API.Embroil
Missed the checkbox... Arghhhhh. Thanks, write this as an answer and I will mark it.Temporal
Sorry, but I don't see any checkbox. Anything else?Herewith
L
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.

Landlubber answered 14/1, 2015 at 17:34 Comment(0)
H
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.

Herewith answered 11/12, 2016 at 13:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.