if (isInitialised()) {
initializeArtefacts(artefactType);
ApplicationContext context = getMainContext();
if(context != null && ((ConfigurableApplicationContext)context).isActive()) {
context.publishEvent(new ArtefactAdditionEvent(artefactGrailsClass));
}
}
return artefactGrailsClass;
}