How to Deploy my Open Source Projects using Maven&

2020-05-14 19:19发布

问题:

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?

回答1:

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



回答2:

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/



回答3:

Have a look at this blog post: http://www.yegor256.com/2014/08/19/how-to-release-to-maven-central.html

It explains how you can configure your project once and deploy to Maven Central in a single click. Rultor.com, a DevOps assistant is involved, and it's free for both commercial and open source projects.