For web applications, try:
ModuleManagementFacade moduleManagementFacade =
WebServletUtils.getModuleManagementFacade(servletContext);
ModuleLocationResolver resolver =
moduleManagementFacade.getModuleLocationResolver();
final Application currentApplication =
moduleManagementFacade.getApplicationManager().getCurrentApplication();
final Set<String> moduleNames =
currentApplication.getModuleStateHolder().getRuntimeModules().keySet();
for (String moduleName : moduleNames) {
System.out.println(resolver.getApplicationModuleClassLocations(moduleName));
}
For standalone apps/tests: replace the first line with
ModuleManagementFacade moduleManagementFacade =
Impala.getFacade().getModuleManagementFacade();
Can't add anything extra with the third party locations though, as
Impala does not know anything about these, except that they are on the
classpath.
Cheers,
Phil