When I was developing on the http-response-headers open source library for spring boot, I was curious how difficult it would be to make this available at maven central. And of course: everything should work automatically with travis ;).
To make your jars available at http://search.maven.org/, you can submit your open source project to "Sonatype OSSRH".
Basically you have 3 steps (OSSRH Guide):
- Create a Jira Account at Sonatype
- Create a Project Ticket
- Deploy to https://oss.sonatype.org/content/repositories/snapshots or https://oss.sonatype.org/service/local/staging/deploy/maven2/.
Therefor you need to:
- Modify your pom.xml
- Add build plugins for binaries, javadoc and sources jar files and gpg signing
- Create a gpg key
- Sign your builds
- Integrate this with travis secured environment variables
The steps 1 and 2 took me some minutes and the response of the sonatype staff came a workday later. Nice.
Since I wanted to automate step 3, the following lines are more like a reminder for myself how I got this working. You can follow the following steps to set this up for your self, too.