{"record":{"id":"c5b580c7eb18c659","repo":"quarkusio/quarkus","slug":"failed-to-locate-pluginxml","errorCode":null,"errorMessage":"Failed to locate <pluginXml>","messagePattern":"Failed to locate <pluginXml>","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/CreateUtils.java","lineNumber":57,"sourceCode":"    }\n\n    public static Plugin resolvePluginInfo(Class<?> cls) throws MojoExecutionException {\n        try {\n            final Path classOrigin = MojoUtils.getClassOrigin(cls);\n            if (Files.isDirectory(classOrigin)) {\n                return resolvePluginInfo(classOrigin.resolve(\"META-INF\").resolve(\"maven\").resolve(\"plugin.xml\"));\n            }\n            try (FileSystem fs = ZipUtils.newFileSystem(classOrigin)) {\n                return resolvePluginInfo(fs.getPath(\"META-INF\", \"maven\", \"plugin.xml\"));\n            }\n        } catch (Exception e) {\n            throw new MojoExecutionException(\"Failed to resolve maven plugin version containing \" + cls, e);\n        }\n    }\n\n    private static Plugin resolvePluginInfo(Path pluginXml) throws MojoExecutionException {\n        if (!Files.exists(pluginXml)) {\n            throw new MojoExecutionException(\"Failed to locate \" + pluginXml);\n        }\n        final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n        try {\n            final DocumentBuilder db = dbf.newDocumentBuilder();\n            try (InputStream is = Files.newInputStream(pluginXml)) {\n                final Document doc = db.parse(is);\n                final Node pluginNode = getElement(doc.getChildNodes(), \"plugin\");\n                final Plugin plugin = new Plugin();\n                plugin.setGroupId(getChildElementTextValue(pluginNode, \"groupId\"));\n                plugin.setArtifactId(getChildElementTextValue(pluginNode, \"artifactId\"));\n                plugin.setVersion(getChildElementTextValue(pluginNode, \"version\"));\n                return plugin;\n            }\n        } catch (Throwable t) {\n            throw new MojoExecutionException(\"Failed to parse \" + pluginXml, t);\n        }\n    }\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/CreateUtils.java#L39-L75","documentation":"The private resolvePluginInfo(Path pluginXml) overload checks Files.exists(pluginXml) first and throws this MojoExecutionException when the plugin descriptor file is absent. This happens when META-INF/maven/plugin.xml was not packaged with the plugin artifact or the wrong path/jar was probed, so the plugin's coordinates/version cannot be read.","triggerScenarios":"resolvePluginInfo(cls) finds a class origin (directory or jar) that does not contain META-INF/maven/plugin.xml — e.g. running from an unpacked/modified plugin directory, a shaded jar that dropped the descriptor, or a jar missing the packaged plugin.xml.","commonSituations":"Manually unpacked plugin jar for debugging; a custom/snapshot build of quarkus-maven-plugin without packaging the descriptor; shade/assembly config excluding META-INF resources; pointing the build at the wrong artifact.","solutions":["Reinstall/re-download the quarkus-maven-plugin artifact: delete it from ~/.m2 and run with -U","Verify the jar actually contains META-INF/maven/plugin.xml: `unzip -l ~/.m2/repository/io/quarkus/.../quarkus-maven-plugin-*.jar | grep plugin.xml`","Stop excluding META-INF/** in any shading/assembly configuration applied to the plugin jar","Use the official plugin artifact via the quarkus.platform pom's pluginManagement instead of a locally built variant"],"exampleFix":"# verify the descriptor is present\nunzip -l quarkus-maven-plugin-x.y.z.jar | grep META-INF/maven/plugin.xml\n# if missing, restore the official artifact\nrm -rf ~/.m2/repository/io/quarkus/quarkus-maven-plugin && mvn -U ...","handlingStrategy":"validation","validationCode":"# Confirm the descriptor exists in the jar before invoking\nunzip -l quarkus-maven-plugin-*.jar | grep 'META-INF/maven/plugin.xml'","typeGuard":null,"tryCatchPattern":"// Caller-side: verify packaged resources before relying on the descriptor\nif (!Files.exists(jarPath)) throw new IllegalStateException(\"Plugin jar missing: \" + jarPath);\ntry (var fs = java.nio.file.FileSystems.newFileSystem(jarPath)) {\n    if (java.nio.file.Files.notExists(fs.getPath(\"META-INF\", \"maven\", \"plugin.xml\"))) {\n        throw new IllegalStateException(\"plugin.xml not packaged in \" + jarPath);\n    }\n}","preventionTips":["Never exclude META-INF/** when shading/packaging the plugin jar","Use official platform-managed plugin artifacts, not hand-built copies","Verify jar integrity after building the plugin locally (mvn install, then unzip -l)"],"tags":["maven","plugin-descriptor","missing-file"],"backgroundTag":"plugin-descriptor-not-found","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"}