diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/devui/deployment/BuildTimeContentProcessor.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/devui/deployment/BuildTimeContentProcessor.java index 55e2896661039..596b62098e474 100644 --- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/devui/deployment/BuildTimeContentProcessor.java +++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/devui/deployment/BuildTimeContentProcessor.java @@ -80,6 +80,7 @@ public class BuildTimeContentProcessor { private static final String SLASH = "/"; private static final String DEV_UI = "dev-ui"; private static final String BUILD_TIME_PATH = "dev-ui-templates/build-time"; + private static final String ES_MODULE_SHIMS = "es-module-shims"; final Config config = ConfigProvider.getConfig(); @@ -294,11 +295,11 @@ QuteTemplateBuildItem createIndexHtmlTemplate( QuteTemplateBuildItem.DEV_UI); Aggregator aggregator = new Aggregator(mvnpmBuildItem.getMvnpmJars()); - for (InternalImportMapBuildItem importMapBuildItem : internalImportMapBuildItems) { Map importMap = importMapBuildItem.getImportMap(); aggregator.addMappings(importMap); } + String esModuleShimsVersion = extractEsModuleShimsVersion(mvnpmBuildItem.getMvnpmJars()); String importmap = aggregator.aggregateAsJson(nonApplicationRootPathBuildItem.getNonApplicationRootPath()); aggregator.reset(); @@ -310,7 +311,8 @@ QuteTemplateBuildItem createIndexHtmlTemplate( "nonApplicationRoot", nonApplicationRoot, "contextRoot", contextRoot, "importmap", importmap, - "themeVars", themeVars); + "themeVars", themeVars, + "esModuleShimsVersion", esModuleShimsVersion); quteTemplateBuildItem.add("index.html", data); @@ -376,6 +378,18 @@ void createBuildTimeData(BuildProducer buildTimeConstPr buildTimeConstProducer.produce(internalBuildTimeData); } + private String extractEsModuleShimsVersion(Set urls) { + for (URL u : urls) { + if (u.getPath().contains(ES_MODULE_SHIMS)) { + int i = u.getPath().indexOf(ES_MODULE_SHIMS) + ES_MODULE_SHIMS.length() + 1; + String versionOnward = u.getPath().substring(i); + String[] parts = versionOnward.split(SLASH); + return parts[0]; + } + } + return ""; + } + private void addThemeBuildTimeData(BuildTimeConstBuildItem internalBuildTimeData, BuildProducer themeVarsProducer) { // Theme details TODO: Allow configuration diff --git a/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui-templates/build-time/index.html b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui-templates/build-time/index.html index 8116f44ae7912..6ecc818195fb2 100644 --- a/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui-templates/build-time/index.html +++ b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui-templates/build-time/index.html @@ -5,7 +5,7 @@ - +