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

  1. Run mvn clean to remove stale/partially extracted web dependency directories and rebuild
  2. Verify the JAR inside the dependency follows the standard WebJar layout (META-INF/resources/<name>/<version>/) or mvnpm layout
  3. Check the version of quarkus-web-dependency-locator and the web dependency for compatibility; upgrade both
  4. 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

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


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/b001d0cf078d308f. Report an issue: GitHub.