{"record":{"id":"cafe50a5f5aaf4a0","repo":"apache/maven","slug":"unable-to-find-pom-on-classpath","errorCode":null,"errorMessage":"Unable to find pom on classpath: {}","messagePattern":"Unable to find pom on classpath: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java","lineNumber":630,"sourceCode":"        //        sessionScope.enter();\n        //        sessionScope.seed(Session.class, s);\n        //        sessionScope.seed(InternalSession.class, s);\n\n        //        MojoExecutionScope mojoExecutionScope = getInjector().getInstance(MojoExecutionScope.class);\n        //        mojoExecutionScope.enter();\n        //        mojoExecutionScope.seed(Project.class, p);\n        //        mojoExecutionScope.seed(MojoExecution.class, me);\n    }\n\n    private Reader openPomUrl(Class<?> holder, String pom, Path[] modelPath) throws IOException {\n        if (pom.startsWith(\"file:\")) {\n            Path path = Paths.get(getBasedir()).resolve(pom.substring(\"file:\".length()));\n            modelPath[0] = path;\n            return Files.newBufferedReader(path);\n        } else if (pom.startsWith(\"classpath:\")) {\n            URL url = holder.getResource(pom.substring(\"classpath:\".length()));\n            if (url == null) {\n                throw new IllegalStateException(\"Unable to find pom on classpath: \" + pom);\n            }\n            return new XmlStreamReader(url.openStream());\n        } else if (pom.contains(\"<project>\")) {\n            return new StringReader(pom);\n        } else {\n            Path path = Paths.get(getBasedir()).resolve(pom);\n            modelPath[0] = path;\n            return Files.newBufferedReader(path);\n        }\n    }\n\n    protected String getPluginDescriptorLocation() {\n        return \"META-INF/maven/plugin.xml\";\n    }\n\n    protected String[] mojoCoordinates(String goal) throws Exception {\n        if (goal.matches(\".*:.*:.*:.*\")) {\n            return goal.split(\":\");","sourceCodeStart":612,"sourceCodeEnd":648,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java#L612-L648","documentation":"Error \"Unable to find pom on classpath: {}\" thrown in apache/maven.","triggerScenarios":"Thrown at impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java:630 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}