Do not rely on boot module loader for finding module dependencies
The `Module.getBootModuleLoader()` API may be deprecated at some point, so use a safer alternative. Closes #28448 Signed-off-by: David M. Lloyd <david.lloyd@redhat.com>
This commit is contained in:
parent
54af571f1e
commit
b5535ac970
2 changed files with 8 additions and 2 deletions
|
@ -61,7 +61,10 @@ public abstract class KeycloakDependencyProcessor implements DeploymentUnitProce
|
|||
}
|
||||
|
||||
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
|
||||
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
|
||||
ModuleLoader moduleLoader = Module.getCallerModuleLoader();
|
||||
if (moduleLoader == null) {
|
||||
moduleLoader = Module.getSystemModuleLoader();
|
||||
}
|
||||
addCommonModules(moduleSpecification, moduleLoader);
|
||||
addPlatformSpecificModules(phaseContext, moduleSpecification, moduleLoader);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,10 @@ public abstract class KeycloakDependencyProcessor implements DeploymentUnitProce
|
|||
// Next phase, need to detect if this is a Keycloak deployment. If not, don't add the modules.
|
||||
|
||||
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
|
||||
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
|
||||
ModuleLoader moduleLoader = Module.getCallerModuleLoader();
|
||||
if (moduleLoader == null) {
|
||||
moduleLoader = Module.getSystemModuleLoader();
|
||||
}
|
||||
|
||||
addCoreModules(moduleSpecification, moduleLoader);
|
||||
addCommonModules(moduleSpecification, moduleLoader);
|
||||
|
|
Loading…
Reference in a new issue