4

I have a Maven project. I added in settings.xml file the configuration for the BinTray server:

<server>
    <id>bintray</id>
    <username>USERNAME</username>
    <password>API_KEY</password>
</server>

Then in the pom.xml I have added:

<distributionManagement>
    <repository>
        <id>bintray</id>
        <url>https://api.bintray.com/maven/USERNAME/maven/PACKAGE_NAME;publish=1</url>
    </repository>
</distributionManagement>

In the BinTray web interface I get the following message:

Notice: You have 16 unpublished item(s) for this package (expiring in 6 days and 22 hours) Discard | Publish

So this means that the artifacts (jar, pom, javadoc, sources, hashes) are not yet published.

So do I need every time when I make a release to go to BinTray web interface to publish the artifacts? Is there a setting to publish them automatically from Maven?

octavian1001
  • 314
  • 2
  • 7
  • I'm not familiar with BinTray, but in case of Maven Central and Sonatype, I had to go to web interface at http://oss.sonatype.org and click release everytime I upload a new library to central repository or update an existing one. Maybe in case of BinTray it works the same way? I don't know if it can be done automatically. – Piotr Wittchen Jul 16 '15 at 12:50
  • This release click can be done via nexus-maven-plugin.... – khmarbaise Jul 16 '15 at 13:09

1 Answers1

4

You need a slightly different distributionManagement block so the matrix parameters are sent to bintray:

<distributionManagement>
    <repository>
        <id>bintray</id>
        <url>https://api.bintray.com/maven/USERNAME/maven/PACKAGE_NAME/;publish=1;</url>
    </repository>
</distributionManagement>
Dror Bereznitsky
  • 20,048
  • 3
  • 48
  • 57
  • Very interesting! The last slash is important, but why it didn't fail saying that the url is wrong... – octavian1001 Jul 20 '15 at 21:07
  • From the Maven point of view the URL is valid, so it will not complain. The problem is that when constructing the request from the distributionManagement URL the matrix params got lost by Maven. From the Bintray side it is also a valid request for uploading a package but not publishing it. – Dror Bereznitsky Jul 21 '15 at 08:13