private void fixConfigFilePathForVfs() {
   if (configFileURL != null && configFileURL.toExternalForm().startsWith("vfs:")) {
     String contextPath = ClasspathKieProject.fixURLFromKProjectPath(configFileURL);
     File contextFile = new File(contextPath);
     if (contextFile.exists()) {
       // the spring context file is 2 folders under the temp folder where the war is unzipped
       contextFile = contextFile.getParentFile().getParentFile();
       File mavenFolder = recurseToMavenFolder(contextFile);
       if (mavenFolder != null) {
         // remove /META-INF/maven since drools pom.properties lookup adds it back
         configFilePath = mavenFolder.getParentFile().getParent();
       }
     }
   }
 }
  protected InternalKieModule createKieModule(KieModuleModel kieProject) {
    if (configFileURL.toString().startsWith("bundle:")) {
      return createOsgiKModule(kieProject);
    }

    if (configFilePath == null) {
      configFilePath = getClass().getResource("/").getPath();
    }

    String rootPath = configFilePath;
    if (rootPath.lastIndexOf(':') > 0) {
      rootPath = configFilePath.substring(rootPath.lastIndexOf(':') + 1);
    }

    return ClasspathKieProject.createInternalKieModule(
        configFileURL, configFilePath, kieProject, releaseId, rootPath);
  }
  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);
      }
    }
  }