What package name should I use for the open source Java library?

I want to publish an open source Java library. I thought about using my last name as the name of the package, but I find this a bit strange. I would like to use something more neutral like "open.libname".

Are there any recommendations for naming an open source Java package?

+7
source share
4 answers

As others have said, run the package name with the changed domain name:

Register a domain such as myproject.org, and then use org.myproject.mymodule .

Or, if you do not have your own domain, use the subdomain where you place the code, for example. if you are net.sourceforge.myproject.mymodule code on myproject.sourceforge.net, use net.sourceforge.myproject.mymodule .

+10
source

The prefix of your package with the domain name that you have in the reverse order: com.mydomain.mypackage . Since you have a domain, the chances of a clash of names are reduced.

Also, the best choice for a package name is that which reflects the functionality of the package, not your own name. What will you use if you want to release a second (and possibly completely unrelated) library?

+4
source

Where do you place your project? For example, when I host a project on Google Code, I prefer to use com.googlecode.project-name (it seems rude to use com.google.code.project-name ). I don’t know what Google thinks about it, but it follows the lead of many Sourceforge.net projects. If you have a personal / corporate domain, then, of course, use it.

+3
source

This may or may not be the answer you are looking for.

The general agreement is to change the name of your personal / corporate domain and add it to any package name.

So, if your domain is "www.feel.com" and your package name is "mypackage", then your full package name will be: com.feel.mypackage

0
source

All Articles