Question

I have recently published a first stable release for my open source library http://jooq.sourceforge.net. On popular demand, I would like to place my artifacts into a maven repository, but I don't know exactly what that means.

I know maven to be a dependency management system. I know that I have to create descriptive XML files for my deliverables. The question is

  1. How do I create that XML file (with what info)?
  2. I have an (optional) dependency on log4j. How do I specify that?
  3. Where do I add that XML file (i.e. inside each .jar file? inside the .zip file)
  4. Where can I upload my artifacts? Are there any public repositories, that I can reference from my project website?
  5. What will I upload to that repository?
Was it helpful?

Solution

It actually isn't that much work to publish the project, but I would strongly recommend you to have a look at the basic concepts of maven first as it can be quite confusing in the beginning.

A guide how to publish your project to the maven central repository can be found here: http://maven.apache.org/guides/mini/guide-central-repository-upload.html

Before publishing you need a working maven build for your project. Therefore you basically need to do two things: Creating a pom.xml and restructuring your source repository a bit, as maven heavily relies on convention over configuration. The source repository finally should be conform tho the maven standard directory layout. For your project it might be enough to move all the javacode to a folder called src/main/java

The pom.xml needs to be created at the root of your projects source. It needs to fullfill the requirements of the central repository and must contains anything relevant about the project like name, license information, dependencies etc. The guide linked above contains a skeleton for it, an exhaustive description can be found at the sonatype pages linked from the guide.

(As I am a new user I am unfortunately not allowed to add more than one link to this post)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top