On semilattices of groups