This is some pretty tricky logic that is likely to be changed/fixed/improved in the future. I'd prefer to keep it in one place: could you instead call NamespaceRegistry.getNamespace(packageName) ? This should give you the groupId as well as ensure that the package and it's dependencies are loaded.