final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
//add jboss-invocation classes needed by the proxies
ModuleDependency invocation = new ModuleDependency(moduleLoader, JBOSS_INVOCATION_ID, false, false, false, false);
invocation.addImportFilter(PathFilters.is("org/jboss/invocation/proxy/classloading"), true);
invocation.addImportFilter(PathFilters.acceptAll(), false);
moduleSpecification.addSystemDependency(invocation);
ModuleDependency ee = new ModuleDependency(moduleLoader, JBOSS_AS_EE, false, false, false, false);
ee.addImportFilter(PathFilters.is("org/jboss/as/ee/component/serialization"), true);
ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent"), true);
ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent/handle"), true);
ee.addImportFilter(PathFilters.acceptAll(), false);
moduleSpecification.addSystemDependency(ee);
//we always add all Java EE API modules, as the platform spec requires them to always be available
//we do not just add the javaee.api module, as this breaks excludes
for (final ModuleIdentifier moduleIdentifier : JAVA_EE_API_MODULES) {
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleIdentifier, true, false, true, false));
}
}