Maven GroupId with special characters
dns, maven
Solution
Per Oracle's documentation on package naming, hyphens (namely, `-`) in DNS names should be replaced with underscores (namely, `_`), names that begin with a number should be pre-underscored (so `me.123.com` becomes `com._123.me`), and names that conflict with a reserved keyword should be post-underscored (so `int.me.com` becomes `com.me.int_`).
Unicode characters are fine, as per the spec for identifiers (for instance, `Character.isJavaIdentifierStart('é')` evaluates to `true`).
Your group names would canonically be `de.heccare`, `de.heccare_international`, and `de.heccare_int`, respectively.
Problem
One best practice for choosing the Maven groupId says to choose the groupId according to the domain name of the company. Some domain names contain special characters, especially hyphen-minus. And moreover with the new non-ASCII-domains a domain name can also contain non-ASCII-characters. Now my questions: Can I use the minus in the groupId? What are reasonable alternatives? How do I handle special characters of non-ASCII domain names in the groupId? A concrete problem: I have to find groupIds for three independent companies: Company A's domain is "heccare.de" Company B's domain is "heccare-international.de" Company C's domain is "heccare-int.de" What are reasonable groupIds?