25

Is there anything I could do to get my own open source stuff into Maven's Central repository?

I've wondered many times how I could get my own projects into Maven's Central repository. I was asking this myself, especially as I've seen some well known projects hosting their own repository, requiring users to add dependency and repository. At the same time, it's getting difficult for other projects to depend on those projects. As I neither want others to add an additional repository nor to host one myself, I'm looking for other ways.

And why aren't some projects using the option to deploy to Maven Central in favor of their self-hosted repository? Any good reasons that aren't obvious?

sfussenegger
  • 35,575
  • 15
  • 95
  • 119
  • 1
    [How to Release to Maven Central, in One Click](http://www.yegor256.com/2014/08/19/how-to-release-to-maven-central.html) – Kshitiz Sharma Jan 12 '15 at 10:22
  • Projects that don't deploy to central prefer more control or easier solutions like https://jitpack.io – Andrejs Nov 04 '15 at 11:17

2 Answers2

35

As Domi mentiones, the easiest way is to use Sonatype's free hosting because to get your artifacts to Maven Central you must first upload them to an "approved forge" - such as Sonatype.

I've written a short guide that describes how to get started with Sonatype whether you use Maven or not to build your OSS project. They have their own guide but it isn't as clear as it should, so I've added those missing bits to my post and I link to the original guide where appropriate. Check http://theholyjava.wordpress.com/2010/02/07/releasing-a-project-to-maven-centr/

Jakub Holý
  • 6,019
  • 3
  • 33
  • 33
18

Have you taken a look at the Guide to uploading artifacts to the Central Repository?

matt b
  • 138,234
  • 66
  • 282
  • 345
  • Thanks for the link. Actually I looked at it a while ago - but obviously forgot about it. As it looks quite simple to do so, I wonder why several projects still don't use that option. – sfussenegger Nov 03 '09 at 08:08
  • 3
    There is even an easier way: http://nexus.sonatype.org/oss-repository-hosting.html – domi Nov 07 '09 at 14:18
  • This link points to a page which says `There are some requirements [...]. The updated list of requirements can be found here.`. However the `here` link is broken. If someone knows the correct links, would it be possible to update the answer accordingly? – gturri Oct 11 '14 at 10:49
  • This guide is obsolete. Another link is broken too: "How to Generate PGP Signatures with Maven". – whirlwin Oct 24 '14 at 07:57
  • 1
    @gturri, I believe the requirements link should lead [here](http://central.sonatype.org/pages/requirements.html) now. – jFrenetic Mar 22 '15 at 17:12
  • 1
    Trying to not sound like a jerk, please embed a complete answer and do not just refer to an outside link. SO is a place to see complete Q&A. Links are fine as part of referencing to sources. – AlikElzin-kilaka Feb 12 '16 at 22:46