quarkusio/quarkus · error · UncheckedIOException
Could not find name directory for ${artifactId} in ${webDepe
Error message
Could not find name directory for ${artifactId} in ${webDependenciesDir} What it means
The Dev UI libraries API in web-dependency-locator expects each web dependency's directory under the processed webDependenciesDir to contain exactly one child directory (the library 'name' directory, e.g. the npm package name). If no subdirectory is found, it throws an IOException (wrapped in UncheckedIOException) reporting which artifactId and directory was scanned. This guards against malformed or unextracted web-dependency layouts.
Source
Thrown at extensions/web-dependency-locator/deployment/src/main/java/io/quarkus/webdependency/locator/deployment/devui/WebDependencyLocatorDevModeApiProcessor.java:100
Map<ArtifactKey, ClassPathElement> webDependencyKeys,
String path) {
// If the dependency is not a runtime class path dependency, return null
if (!dep.isRuntimeCp()) {
return null;
}
final ClassPathElement provider = webDependencyKeys.get(dep.getKey());
if (provider == null) {
return null;
}
final WebDependencyLibrary webDependencyLibrary = new WebDependencyLibrary(provider.getDependencyKey().getArtifactId());
provider.apply(tree -> {
final Path webDependenciesDir = tree.getPath(PREFIX + path);
final Path nameDir;
try (Stream<Path> webDependenciesDirPaths = Files.list(webDependenciesDir)) {
nameDir = webDependenciesDirPaths.filter(Files::isDirectory).findFirst().orElseThrow(() -> new IOException(
"Could not find name directory for " + dep.getKey().getArtifactId() + " in " + webDependenciesDir));
} catch (IOException e) {
throw new UncheckedIOException(e);
}
final Path versionDir;
Path root = nameDir;
// The base URL for the Web Dependency
final StringBuilder urlBase = new StringBuilder(webDependencyRootPath);
boolean appendRootPart = true;
try {
// If the version directory exists, use it as a root, otherwise use the name directory
versionDir = nameDir.resolve(dep.getVersion());
root = Files.isDirectory(versionDir) ? versionDir : nameDir;
urlBase.append(nameDir.getFileName().toString())
.append("/");
appendRootPart = false;
} catch (InvalidPathException e) {
log.warn("Could not find version directory for " + dep.getKey().getArtifactId() + " "
+ dep.getVersion() + " in " + nameDir + ", falling back to name directory");
}
webDependencyLibrary.setVersion(dep.getVersion());View on GitHub (pinned to e1c734241f)
Solutions
- Run mvn clean to remove stale/partially extracted web dependency directories and rebuild
- Verify the JAR inside the dependency follows the standard WebJar layout (META-INF/resources/<name>/<version>/) or mvnpm layout
- Check the version of quarkus-web-dependency-locator and the web dependency for compatibility; upgrade both
- Remove and re-add the offending web dependency to force re-extraction
Example fix
// before: manual layout without name dir // target/webDependencies/<artifactId>/ (empty, files dumped flat) // after: standard layout // target/webDependencies/<artifactId>/<name>/<version>/...
Defensive patterns
Strategy: validation
Validate before calling
final File dir = new File("target/web-dependencies/<artifactId>");
boolean ok = dir.isDirectory()
&& java.util.Arrays.stream(dir.listFiles(File::isDirectory)).count() > 0; Prevention
- Use standard WebJar/mvnpm artifacts with the conventional layout
- Run mvn clean when switching versions or branches
- Never hand-place files into the extracted web-dependencies directory
When it happens
Trigger: Calling the Dev UI endpoint that lists web dependency libraries when a dependency's extracted directory under webDependenciesDir has no subdirectories at all (empty or flat layout).
Common situations: Using a WebJar with a non-standard internal layout; a build cache or previous failed build leaving a partially extracted/empty directory; custom web dependencies placed manually under the target directory without the expected name/version nesting.
Related errors
- A generic type is not allowed here; try creating a subclass
- Build item class must be leaf (final) types: %s
- Cannot construct empty build items
- Failed to open path tree with root %s
- Failed to load CodeGenProvider class from deployment classlo
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/b001d0cf078d308f.
Report an issue: GitHub.