26

I have a stable opensource library and was wondering how (and if) I can publish my lib to maven official repositories so people can include it in their pom.xml files and get the dependency downloaded automatically.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
Pablo Fernandez
  • 103,170
  • 56
  • 192
  • 232
  • 1
    Since this is the Java world, it will of course be 20 times less obvious than publishing `npm` packages for JavaScript. – Andy May 03 '17 at 02:12

3 Answers3

21

The process to get your library in the central repostiory is documented in the Guide to uploading artifacts to the Central Repository. In short, the new process is to get your project hosted by one of the approved Forges that will be synced with central, the Maven folks don't rsync personal repository anymore. In your case, your best bet would be to use the Sonatype Forge (open to any OSS Project). Check the given link (and also this document).

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
  • Take a look to the [Sonatype OSS Maven Repository Usage Guide](https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide). – Davide Pastore Dec 05 '13 at 12:14
  • This blog post helped me to do it - http://zserge.com/blog/gradle-maven-publish.html – josketres Dec 28 '14 at 18:03
  • From the Sonatype OSS guide: "1. Create your JIRA account. 2. Create a new project ticket. This triggers creation of your repositories. Normally, the process takes less than 2 business days." LOLOLOLOLOLOL – Andy May 03 '17 at 02:14
4

If you want reliable access for everyone out there, you need to stick with central. Due to the tendency of people at dev.java.net to break rules about the immutability of released artifacts, some people don't trust it. Further, it can be Very Slow.

To get your project into central, you need have your code in some public repo that they can sync from.

bmargulies
  • 97,814
  • 39
  • 186
  • 310
2
lexicore
  • 42,748
  • 17
  • 132
  • 221