On the internets there is quite a lot of conflicting information on how/if binaries can be deployed to Maven Central. As I would like to avoid hiding them inside the JAR, I have found the guide which suggests using the POM target and then the codehaus plugin in order to deploy the required binary:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>mybinary.so</file>
<type>so</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I use the following ANT task to upload the binary:
<target name="stage" depends="" description="deploy release version to Maven staging repository">
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${ossrh-staging-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=mybinary.so" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
When I run the task, I can see my binary uploading and the SUCCESS return message, but when I log in and check the OSS control panel, my upload only contains the POM file.
Any clues? Any success stories? And finally why is this so difficult, to me Ivy was already too complicated after pypi, but Maven seems oh-so-much-worse.