apache/maven · error · IllegalStateException

Unable to find pom on classpath: {}

Error message

Unable to find pom on classpath: {}

What it means

Error "Unable to find pom on classpath: {}" thrown in apache/maven.

Source

Thrown at impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java:630

        //        sessionScope.enter();
        //        sessionScope.seed(Session.class, s);
        //        sessionScope.seed(InternalSession.class, s);

        //        MojoExecutionScope mojoExecutionScope = getInjector().getInstance(MojoExecutionScope.class);
        //        mojoExecutionScope.enter();
        //        mojoExecutionScope.seed(Project.class, p);
        //        mojoExecutionScope.seed(MojoExecution.class, me);
    }

    private Reader openPomUrl(Class<?> holder, String pom, Path[] modelPath) throws IOException {
        if (pom.startsWith("file:")) {
            Path path = Paths.get(getBasedir()).resolve(pom.substring("file:".length()));
            modelPath[0] = path;
            return Files.newBufferedReader(path);
        } else if (pom.startsWith("classpath:")) {
            URL url = holder.getResource(pom.substring("classpath:".length()));
            if (url == null) {
                throw new IllegalStateException("Unable to find pom on classpath: " + pom);
            }
            return new XmlStreamReader(url.openStream());
        } else if (pom.contains("<project>")) {
            return new StringReader(pom);
        } else {
            Path path = Paths.get(getBasedir()).resolve(pom);
            modelPath[0] = path;
            return Files.newBufferedReader(path);
        }
    }

    protected String getPluginDescriptorLocation() {
        return "META-INF/maven/plugin.xml";
    }

    protected String[] mojoCoordinates(String goal) throws Exception {
        if (goal.matches(".*:.*:.*:.*")) {
            return goal.split(":");

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java:630 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/cafe50a5f5aaf4a0. Report an issue: GitHub.