mirror of
https://github.com/keycloak/keycloak.git
synced 2025-12-20 14:00:09 -06:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user