Skip to content
Toby Crawley edited this page Jan 9, 2023 · 38 revisions

Every jar uploaded to Clojars.org belongs to a group, which corresponds to the Maven groupId. Groups act as a namespacing mechanism so that multiple users can upload different forks of a project. They are also used as a simple access-control mechanism: only users that are members of a group can push jars to it.

By convention the Maven community uses a reversed domain name (like org.apache.maven) as the group name for a project to ensure uniqueness. Maven Central enforces this as a requirement for publishing there; Clojars historically did not, but does require a verified reversed domain name group for any new projects created after 2021-04-18. If you have a domain name that you control, you can use that as the group ID. Alternatively Clojars provides two default group names that are automatically verified for your account, and you can gain additional verified group names if you log in to Clojars via your GitHub or GitLab.com account. See below for more details.

Canonical group

A canonical group is for the main, official version of a project.

Personal groups

Each user automatically gets their own verified groups named org.clojars.username and net.clojars.username. The org groups have historically been used to hold things like throwaway alpha versions and forks of other projects, but the net groups don’t have that history. You are free to use either group as you like.

If you have a GitHub or GitLab.com account, you can log in via GitHub or GitLab.com. Doing so will create additional verified groups for you to use for your projects (com.github.clojars-username & io.github.clojars-username or com.gitlab.clojars-username & io.gitlab.clojars-username, respectively).

Creating a group

In order to use a new group, you have to verify it first, and it has to either be a reverse domain name, or an organisation you control on your githost (either github or gitlab) i.e. either com.github.github-organisation, io.github.github-organisation, or com.gitlab.gitlab-organisation, io.gitlab.gitlab-organisation respectively .

You can verify either of these by creating either a DNS TXT record on the corresponding domain with a value of clojars-[your-clojars-username] to verify you have rights to use the domain as a group, or in the case of a githost organisation creating a public repository in that organisation with the name clojars-[your-clojars-username]. You can then use the self-service verification page on Clojars to verify the group based on this information. Please file a support request with the Clojars administrators if you have any issues with this process.

See Verified-Group-Names for the rationale behind this requirement. If you don’t have a domain name or githost organisation you can use for a group, feel free to use one of the auto-created groups outlined above.

Once the administration request is completed by an admin, the group will exist and you can push new projects to it.

Once you have a group to use, simply specify it in your deploy tool configuration:

Leiningen project.clj:

(defproject com.example/myproject "1.0"
  ...)

Maven pom.xml (for maven or deps-deploy :

<project>
    <groupId>com.example</groupId>
    <artifactId>myproject</artifactId>
    <version>1.0</version>
</project>

Creating/verifying sub-domain groups

If you want to use a group that is based on a sub-domain, you just need to verify the base domain. You can then request verification of any sub-domain group by filing an issue and requesting the group; there is no additional verification step since the base domain is already verified. The sub-domain doesn’t have to actually exist in DNS. The new group will initially have one member, and that will be the account that verified the base domain.

For example, if you have already verified org.tcrawley, you can request org.tcrawley.awesome-sauce, and it will be verified without any additional proof. As another example, if you already verified com.github.tobias, you can use the same process above to verify com.github.tobias.awesome-sauce.

Adding members to a group

You can add a member to a group by clicking the group’s name on your dashboard and selecting “add new member” at the end of the member lists. Enter the person’s username.