{"record":{"id":"9e6f8edb5fb02e02","repo":"quarkusio/quarkus","slug":"could-not-resolve-pom-for","errorCode":null,"errorMessage":"Could not resolve POM for ","messagePattern":"Could not resolve POM for ","errorType":"exception","errorClass":"UnresolvableModelException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/GradleAssistedMavenModelResolverImpl.java","lineNumber":48,"sourceCode":"    public GradleAssistedMavenModelResolverImpl(Project project) {\n        this.project = project;\n    }\n\n    private static GAV cacheKey(String groupId, String artifactId, String version) {\n        return new GAV(groupId, artifactId, version);\n    }\n\n    @Override\n    public ModelSource2 resolveModel(String groupId, String artifactId, String version)\n            throws UnresolvableModelException {\n        GAV key = cacheKey(groupId, artifactId, version);\n\n        File pomFile = pomCache\n                .computeIfAbsent(key, this::resolvePomViaQuery)\n                .orElse(null);\n\n        if (pomFile == null) {\n            throw new UnresolvableModelException(\n                    \"Could not resolve POM for \" + groupId + \":\" + artifactId + \":\" + version,\n                    groupId, artifactId, version);\n        }\n\n        final File resolvedPom = pomFile;\n        return new ModelSource2() {\n            @Override\n            public InputStream getInputStream() throws IOException {\n                return new FileInputStream(resolvedPom);\n            }\n\n            @Override\n            public String getLocation() {\n                return resolvedPom.getAbsolutePath();\n            }\n\n            @Override\n            public ModelSource2 getRelatedSource(String relPath) {","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/GradleAssistedMavenModelResolverImpl.java#L30-L66","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add the missing repository to your Gradle build (repositories { maven { url ... } }) so the coordinates are resolvable.","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).","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.","Check network connectivity/credentials for private repositories (add credentials in ~/.gradle/gradle.properties).","Clear failed-download markers in the cache and retry if a transient network error left the artifact unresolved."],"exampleFix":"// before (build.gradle)\ndependencies { implementation 'com.example:app:1.0' } // parent pom of app not resolvable\n// after\nrepositories { mavenCentral(); maven { url 'https://nexus.example.com/repository/maven-public' } }\ndependencies { implementation 'com.example:app:1.0' }","handlingStrategy":"validation","validationCode":"// Verify a POM is resolvable before the build:\ndef g = 'com.example'; def a = 'app'; def v = '1.0'\ndef url = \"https://repo.example.com/${g.replace('.', '/')}/${a}/${v}/${a}-${v}.pom\"\nassert ['curl', '-sfI', url].execute().waitFor() == 0 : \"POM ${g}:${a}:${v} not resolvable from repository\"","typeGuard":null,"tryCatchPattern":"try {\n    quarkusBuild()\n} catch (UnresolvableModelException e) {\n    logger.error(\"POM ${e.groupId}:${e.artifactId}:${e.version} unresolvable — check repositories and coordinates\")\n}","preventionTips":["Declare all required repositories in build.gradle/settings.gradle, including private ones","Import BOMs and parent-POM-providing artifacts via platform()/enforcedPlatform() so Gradle resolves them","Validate dependency coordinates and versions against the repository before upgrading","Configure repository credentials in ~/.gradle/gradle.properties and test reachability in CI"],"tags":["maven","gradle","pom","dependency-resolution","quarkus"],"backgroundTag":"unresolvable-pom","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"}