{"record":{"id":"b001d0cf078d308f","repo":"quarkusio/quarkus","slug":"could-not-find-name-directory-for-artifactid-in","errorCode":null,"errorMessage":"Could not find name directory for ${artifactId} in ${webDependenciesDir}","messagePattern":"Could not find name directory for (.+?) in (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"extensions/web-dependency-locator/deployment/src/main/java/io/quarkus/webdependency/locator/deployment/devui/WebDependencyLocatorDevModeApiProcessor.java","lineNumber":100,"sourceCode":"            Map<ArtifactKey, ClassPathElement> webDependencyKeys,\n            String path) {\n        // If the dependency is not a runtime class path dependency, return null\n        if (!dep.isRuntimeCp()) {\n            return null;\n        }\n        final ClassPathElement provider = webDependencyKeys.get(dep.getKey());\n        if (provider == null) {\n            return null;\n        }\n        final WebDependencyLibrary webDependencyLibrary = new WebDependencyLibrary(provider.getDependencyKey().getArtifactId());\n        provider.apply(tree -> {\n            final Path webDependenciesDir = tree.getPath(PREFIX + path);\n            final Path nameDir;\n            try (Stream<Path> webDependenciesDirPaths = Files.list(webDependenciesDir)) {\n                nameDir = webDependenciesDirPaths.filter(Files::isDirectory).findFirst().orElseThrow(() -> new IOException(\n                        \"Could not find name directory for \" + dep.getKey().getArtifactId() + \" in \" + webDependenciesDir));\n            } catch (IOException e) {\n                throw new UncheckedIOException(e);\n            }\n            final Path versionDir;\n            Path root = nameDir;\n            // The base URL for the Web Dependency\n            final StringBuilder urlBase = new StringBuilder(webDependencyRootPath);\n            boolean appendRootPart = true;\n            try {\n                // If the version directory exists, use it as a root, otherwise use the name directory\n                versionDir = nameDir.resolve(dep.getVersion());\n                root = Files.isDirectory(versionDir) ? versionDir : nameDir;\n                urlBase.append(nameDir.getFileName().toString())\n                        .append(\"/\");\n                appendRootPart = false;\n            } catch (InvalidPathException e) {\n                log.warn(\"Could not find version directory for \" + dep.getKey().getArtifactId() + \" \"\n                        + dep.getVersion() + \" in \" + nameDir + \", falling back to name directory\");\n            }\n            webDependencyLibrary.setVersion(dep.getVersion());","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/web-dependency-locator/deployment/src/main/java/io/quarkus/webdependency/locator/deployment/devui/WebDependencyLocatorDevModeApiProcessor.java#L82-L118","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before: manual layout without name dir\n// target/webDependencies/<artifactId>/ (empty, files dumped flat)\n// after: standard layout\n// target/webDependencies/<artifactId>/<name>/<version>/...","handlingStrategy":"validation","validationCode":"final File dir = new File(\"target/web-dependencies/<artifactId>\");\nboolean ok = dir.isDirectory()\n    && java.util.Arrays.stream(dir.listFiles(File::isDirectory)).count() > 0;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["quarkus","dev-ui","web-dependency-locator","file-layout"],"backgroundTag":"webjar-layout-invalid","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}