quarkusio/quarkus · error · UnresolvableModelException

Could not resolve POM for

Error message

Could not resolve POM for 

What it means

Thrown by GradleAssistedMavenModelResolverImpl.resolveModel as an org.apache.maven.model.resolution.UnresolvableModelException when a POM cannot be fetched for the given groupId:artifactId:version. The resolver first tries resolvePomViaQuery (queried against the Gradle resolution context) and caches results in pomCache; when the query yields no POM file, it throws with the full coordinates. This bridges Gradle-resolved dependencies into a Maven model resolver used by the Quarkus build tooling.

Source

Thrown at devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/GradleAssistedMavenModelResolverImpl.java:48

    public GradleAssistedMavenModelResolverImpl(Project project) {
        this.project = project;
    }

    private static GAV cacheKey(String groupId, String artifactId, String version) {
        return new GAV(groupId, artifactId, version);
    }

    @Override
    public ModelSource2 resolveModel(String groupId, String artifactId, String version)
            throws UnresolvableModelException {
        GAV key = cacheKey(groupId, artifactId, version);

        File pomFile = pomCache
                .computeIfAbsent(key, this::resolvePomViaQuery)
                .orElse(null);

        if (pomFile == null) {
            throw new UnresolvableModelException(
                    "Could not resolve POM for " + groupId + ":" + artifactId + ":" + version,
                    groupId, artifactId, version);
        }

        final File resolvedPom = pomFile;
        return new ModelSource2() {
            @Override
            public InputStream getInputStream() throws IOException {
                return new FileInputStream(resolvedPom);
            }

            @Override
            public String getLocation() {
                return resolvedPom.getAbsolutePath();
            }

            @Override
            public ModelSource2 getRelatedSource(String relPath) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add the missing repository to your Gradle build (repositories { maven { url ... } }) so the coordinates are resolvable.
  2. Verify the G:A:V in the message is correct and the version actually exists in the repositories (check the remote repo in a browser or curl the POM URL).
  3. Declare the dependency (or the BOM via a platform() dependency) in a Gradle configuration so Gradle resolves and caches its POM before Quarkus queries it.
  4. Check network connectivity/credentials for private repositories (add credentials in ~/.gradle/gradle.properties).
  5. Clear failed-download markers in the cache and retry if a transient network error left the artifact unresolved.

Example fix

// before (build.gradle)
dependencies { implementation 'com.example:app:1.0' } // parent pom of app not resolvable
// after
repositories { mavenCentral(); maven { url 'https://nexus.example.com/repository/maven-public' } }
dependencies { implementation 'com.example:app:1.0' }
Defensive patterns

Strategy: validation

Validate before calling

// Verify a POM is resolvable before the build:
def g = 'com.example'; def a = 'app'; def v = '1.0'
def url = "https://repo.example.com/${g.replace('.', '/')}/${a}/${v}/${a}-${v}.pom"
assert ['curl', '-sfI', url].execute().waitFor() == 0 : "POM ${g}:${a}:${v} not resolvable from repository"

Try / catch

try {
    quarkusBuild()
} catch (UnresolvableModelException e) {
    logger.error("POM ${e.groupId}:${e.artifactId}:${e.version} unresolvable — check repositories and coordinates")
}

Prevention

When it happens

Trigger: During application model building, Quarkus needs the Maven POM of a dependency (e.g. to walk parent POMs, dependency management, or BOM imports). resolvePomViaQuery returns Optional.empty for the coordinates — the artifact is not in any Gradle-resolved configuration and no repository in the Gradle setup can supply the POM.

Common situations: Parent POMs or BOM imports of dependencies that are not themselves declared in the Gradle dependency graph (Gradle never resolved them); missing repositories in settings.gradle/build.gradle for a private artifact; wrong coordinates/version (typo, removed version); offline mode or unreachable remote repositories.

Related errors


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