简体   繁体   中英

When using the Java package naming convention, what happens if you no longer own the domain name

The official suggestion for Java package names is to use a reversed version of a domain name related to the project (preferably one that the project will be distributed on).

What happens if (for whatever reason) the project owners no longer own the domain name but still own the project? The domain and thus the right to the reverse-domain package name now belongs to someone else, so does this mean the package names have to be changed and if so, how?

For those who can't imagine a situation in which a group of programmers loose the domain name they were using for hosting, here are some examples of such situations:

  • The owners may no longer be able to afford the domain and may have to switch to a cheaper domain or use a free domain/distribution service.
  • They may be offered a lot of money for the domain by a company that
    desperately wants it for whatever reason.
  • The project owners may be charged with domain squatting, whether the squatting was intentional or not.

I am aware that these are still unlikely circumstances, but they are possible and this question is intentionally hypothetical.

The package naming convention/suggestions is just a practical way to make full class names unique and thus avoid possible conflicts between different libraries. If everyone followed the convention and you used your own domain name, then it is highly unlikely that someone else named a class the same way you did (since they do not own the domain).

Practically, even if you lose your domain, the chances that the universe of all users of your old library and the universe of all users of a possible future owner of the domain who happens write Java code are still incredibly small :)

If you are using a company domain to release your program: the company is making a release (not you).

If by some reason: you sell this company; you sell the domain; you make what ever: the release still under the company's domain.

If you must do a new release under a new company: you make a refactoring in your code (changing the packages name) and make the release. The Central Repository (maven) verify if you are the owner of domain you made the release. Is expected that you are the "owner" (or authorized person) of the domain: after all; the company is making a release. This is a requirement of making a release under the maven central repo here , and is a good behavior that should be followed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM