@ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext . getDeploymentUnit ( ) ; final List < KernelDeploymentXmlDescriptor > kdXmlDescriptors = unit . getAttachment ( KernelDeploymentXmlDescriptor . ATTACHMENT_KEY ) ; if ( kdXmlDescriptors == null || kdXmlDescriptors . isEmpty ( ) ) return ; for ( KernelDeploymentXmlDescriptor kdxd : kdXmlDescriptors ) { if ( kdxd . getBeanFactoriesCount ( ) > 0 ) { final ModuleSpecification moduleSpecification = unit . getAttachment ( Attachments . MODULE_SPECIFICATION ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; ModuleDependency dependency = new ModuleDependency ( moduleLoader , POJO_MODULE , false , false , false , false ) ; PathFilter filter = PathFilters . isChildOf ( BaseBeanFactory . class . getPackage ( ) . getName ( ) ) ; dependency . addImportFilter ( filter , true ) ; dependency . addImportFilter ( PathFilters . rejectAll ( ) , false ) ; moduleSpecification . addSystemDependency ( dependency ) ; return ; } } }
Add POJO module if we have any bean factories .