Java – How to create and publish a useful Java library

javalibrariesopen source

I've recently worked on a Java class that generates permutations per list of objects. In any case, I would like to have this library offered to the public, so I have several questions:

  • Most libraries I see have this complicated package naming, specifically including com/org. Is there a convention for these or is a permutations package enough?
  • Is there a specific format to publish these? Should I include separate WARs for source code / javadoc?
  • I have the files on a GitHub repository. I guess I can serve the files there, but how do I get people to find my repo?

Best Answer

  • A standard way to publish (apart from the source code on GitHub) is to have formal JAR/WAR releases to Maven Central which many (Maven, Gradle, Ant/Ivy) build tools use to bring in libraries as a dependency. To do this, the best way is to go through the Nexus process.

  • It's also considered friendly to host those same JAR/WARs on a code hosting repo such as Sourceforge or GitHub.

  • In terms of your domain. I recommend you buy firstnamelastname.net/org/com and use that as your naming scheme (e.g. for me it's net.martijnverburg.foobar). Otherwise using the github domain as suggested by @Daniel Moura is a good one.

  • To publicise it, blog about it, twitter about it, submit it to hacker news, reddit, digg, slashdot, dzone, TSS, javaworld etc

HTH!

Related Topic