private void addKieModuleToRepo(KieModuleModel kieProject) {
    KieBuilderImpl.setDefaultsforEmptyKieModule(kieProject);

    InternalKieModule kJar = createKieModule(kieProject);

    if (kJar != null) {
      KieServices ks = KieServices.Factory.get();
      log.info("adding KieModule from " + configFileURL.toExternalForm() + " to repository.");
      ks.getRepository().addKieModule(kJar);
      KieSpringUtils.setReleaseIdForContext(releaseId, context);
    }
  }
  public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
      throws BeansException {
    log.info(":: BeanFactoryPostProcessor::postProcessBeanFactory called ::");
    if (releaseId == null && configFilePath != null) {
      fixConfigFilePathForVfs();
      String pomProperties = ClasspathKieProject.getPomProperties(configFilePath);
      releaseId = ReleaseIdImpl.fromPropertiesString(pomProperties);
      KieSpringUtils.setDefaultReleaseId(releaseId);
    }

    for (String beanDef : beanFactory.getBeanDefinitionNames()) {
      BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanDef);
      if (beanDefinition.getBeanClassName().equalsIgnoreCase(KModuleFactoryBean.class.getName())) {
        KieModuleModel kieModuleModel = fetchKieModuleModel(beanFactory);
        addKieModuleToRepo(kieModuleModel);
      }
    }
  }