quarkusio/quarkus · error · BuildException
Duplicate endpoints detected, the endpoint for static resour
Error message
Duplicate endpoints detected, the endpoint for static resources must be unique: <duplicates>
What it means
GeneratedStaticResourcesProcessor validates at build time that every GeneratedStaticResourceBuildItem has a unique endpoint URL. If two or more build items produce the same endpoint, it throws BuildException listing the duplicates, because Vert.x routes would otherwise be ambiguous.
Source
Thrown at extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/GeneratedStaticResourcesProcessor.java:98
nativeImageResourcesProducer.produce(new NativeImageResourceBuildItem(parent));
}
}
}
}
@BuildStep(onlyIfNot = IsProduction.class)
@Record(ExecutionTime.RUNTIME_INIT)
public void process(List<GeneratedStaticResourceBuildItem> generatedStaticResources,
LaunchModeBuildItem launchModeBuildItem,
BuildProducer<RouteBuildItem> routes, GeneratedStaticResourcesRecorder generatedStaticResourcesRecorder,
BuildProducer<NotFoundPageDisplayableEndpointBuildItem> notFoundPageProducer) throws BuildException {
if (generatedStaticResources.isEmpty()) {
return;
}
List<String> duplicates = collectDuplicates(generatedStaticResources);
if (!duplicates.isEmpty()) {
throw new BuildException(
"Duplicate endpoints detected, the endpoint for static resources must be unique: " + duplicates);
}
Map<String, String> generatedFilesResources = generatedStaticResources.stream()
.peek(path -> notFoundPageProducer.produce(new NotFoundPageDisplayableEndpointBuildItem(path.getEndpoint())))
.filter(GeneratedStaticResourceBuildItem::isFile)
.collect(Collectors.toMap(GeneratedStaticResourceBuildItem::getEndpoint,
GeneratedStaticResourceBuildItem::getFileAbsolutePath));
Set<String> generatedClassPathResources = generatedStaticResources.stream()
.map(GeneratedStaticResourceBuildItem::getEndpoint)
.collect(Collectors.toSet());
routes.produce(RouteBuildItem.builder()
.orderedRoute("/*", ROUTE_ORDER, generatedStaticResourcesRecorder.createRouteCustomizer())
.handler(generatedStaticResourcesRecorder.createHandler(generatedClassPathResources, generatedFilesResources))
.build());
}
private static String buildGeneratedStaticResourceLocation(View on GitHub (pinned to e1c734241f)
Solutions
- Change the endpoint path of the conflicting GeneratedStaticResourceBuildItem (usually via the extension's config property)
- Disable/remove one of the extensions or build steps producing the duplicate
- Check the duplicate list in the error message to see which endpoints collide
Example fix
// before (two build steps)
produce(new GeneratedStaticResourceBuildItem("/assets", ...)); // extension A
produce(new GeneratedStaticResourceBuildItem("/assets", ...)); // extension B
// after
produce(new GeneratedStaticResourceBuildItem("/assets-a", ...));
produce(new GeneratedStaticResourceBuildItem("/assets-b", ...)); Defensive patterns
Strategy: validation
Validate before calling
Map<String, Long> counts = buildItems.stream()
.collect(Collectors.groupingBy(GeneratedStaticResourceBuildItem::getEndpoint, Collectors.counting()));
List<String> dupes = counts.entrySet().stream().filter(e -> e.getValue() > 1).map(Map.Entry::getKey).toList();
if (!dupes.isEmpty()) throw new IllegalStateException("Duplicate static resource endpoints: " + dupes); Prevention
- Namespace generated resource endpoints per extension or per feature
- Make endpoints configurable and default to unique paths
- Audit installed extensions for overlapping default static resource paths
When it happens
Trigger: Two extensions or two build steps each produce a GeneratedStaticResourceBuildItem with the same endpoint path; GeneratedStaticResourceProcessor.process detects duplicates via collectDuplicates and fails the build.
Common situations: Installing multiple Quarkus extensions that both generate static resources under the same default endpoint (e.g. two UI extensions choosing the same path); an application's own build step colliding with an extension's default path; upgrading an extension that changed its default endpoint into an existing one.
Related errors
- Multiple checked templates exist for the template path %s:
- Only a single instance of '${annotation}' is allowed per RES
- Detected two @PermissionChecker annotations with same value
- graphql/graphql-client.js not found on classpath
- Invalid configuration: quarkus.http.static-dir.path must poi
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/f743f9438a281e44.
Report an issue: GitHub.