Deploying Alfresco extensions to Maven Central repository
At Beecon we were in the lucky situation that we could also involve Ole and Samuel and Richard as Alfresco employees into the topic but we decided quickly that it would not be feasible at the moment to bring the artifacts in Alfresco’s maven repository as there is currently no process to deploy external projects to that repository.
Since I believe more Alfresco extensions should got this way here is the process to get any artifacts hosted on Maven Central:
- Register at the Sonatype Jira and request a repository hosting by creating a ticket
- When your account is set up you can later use these Jira credentials for the maven artifact upload to Nexus as well
- You need to follow a number of policies in your project to get through the staging process at Sonatype:
- Add a license descriptor to the POM, you need an open source license of course
- Add SCM hosting and project urls as well as maintainer information
- Set up GPG to allow code signing (your public GPG key needs to be registered with a public key server)
- Upload the artifacts using mvn deploy -Prelease (I used a release profile to be able to control the code signing)
- When you upload for the first time you need to tell Sonatype (by commenting on the Jira ticket) to set up a sync job with maven central.
After one or two hours the artifacts from oss.sonatype.org are available on maven central and through the search. You might need to add <type>amp</type> to the dependency instructions displayed on the Maven search site.
To set this whole process up you might need a few hours before everything is working. I suggest looking at these links for more information:
Some additional remarks:
- You can update the artifacts of an existing version (for me it took about an hour to synchronize). Usually you should not do that as consumers might not get the updates.
- You can also use SNAPSHOT versions but they will not upload to Maven Central so you would need to add the oss.sonatype.org repository to your POM for those to be used.
If you have any questions or remarks leave a comment or reach out on twitter.