{"record":{"id":"949b7e3d5c37623a","repo":"quarkusio/quarkus","slug":"has-not-been-previously-resolved","errorCode":null,"errorMessage":"Has not been previously resolved","messagePattern":"Has not been previously resolved","errorType":"exception","errorClass":"UnresolvableModelException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/LocalRepoModelResolver.java","lineNumber":46,"sourceCode":"        this.pomResolvers = pomResolvers;\n    }\n\n    @Override\n    public File resolvePom(String groupId, String artifactId, String version) {\n        for (LocalPomResolver pomResolver : pomResolvers) {\n            var pom = pomResolver.resolvePom(groupId, artifactId, version);\n            if (pom != null) {\n                return pom;\n            }\n        }\n        return null;\n    }\n\n    @Override\n    public ModelSource resolveModel(String groupId, String artifactId, String version) throws UnresolvableModelException {\n        var pomXml = resolvePom(groupId, artifactId, version);\n        if (pomXml == null) {\n            throw new UnresolvableModelException(\"Has not been previously resolved\", groupId, artifactId, version);\n        }\n        return new ModelSource2() {\n            @Override\n            public InputStream getInputStream() throws IOException {\n                return new FileInputStream(pomXml);\n            }\n\n            @Override\n            public String getLocation() {\n                return pomXml.getAbsolutePath();\n            }\n\n            @Override\n            public ModelSource2 getRelatedSource(String relPath) {\n                return null;\n            }\n\n            @Override","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/LocalRepoModelResolver.java#L28-L64","documentation":"LocalRepoModelResolver is a Maven ModelResolver used during POM model building that can only resolve POMs already present in the local repository (or via its configured LocalPomResolvers); it never downloads from remote repositories. When asked for a GAV that has not been previously resolved into the local repo, it throws this UnresolvableModelException with the literal message 'Has not been previously resolved'. This is intentional: it is used for offline-style model building where only previously cached POMs are expected.","triggerScenarios":"Calling MavenModelBuilder/resolveModel flows that build a POM whose parent or dependency POM is not present in ~/.m2/repository; using the resolver while offline or with local-repo-only mode before the artifact has ever been downloaded; referencing a parent/dependency version that does not exist in the local repository.","commonSituations":"Fresh CI machines or Docker images with an empty local repo; running with -o (offline) or quarkus bootstrap offline resolvers; typos in groupId/artifactId/version of a parent; a dependency that was declared but never downloaded (e.g. dependency resolution skipped).","solutions":["Pre-populate the local repository by running a normal (online) Maven resolution of the project (mvn dependency:go-offline or a prior Quarkus resolve) so the POM is cached","Check that groupId:artifactId:version in the failing parent/dependency reference is correct and exists","Disable offline mode / remove local-repo-only configuration so a remote-capable resolver is used","Clear corrupt local repo entries for the artifact (delete its directory in ~/.m2/repository) and re-resolve"],"exampleFix":"// before (offline resolve with empty ~/.m2)\nnew ApplicationModelBuilder().setOffline(true).resolve();\n// after\nmvn dependency:go-offline  // then run offline resolve","handlingStrategy":"try-catch","validationCode":"File pom = new File(localRepo, g/artifactId + \"/\" + version + \"/\" + artifactId + \"-\" + version + \".pom\");\nif (!pom.isFile()) { /* resolve online first or fail fast */ }","typeGuard":"boolean isCached(GAV gav) {\n    return java.nio.file.Files.isRegularFile(java.nio.file.Path.of(\n        System.getProperty(\"user.home\"), \".m2\", \"repository\",\n        gav.groupId().replace('.', '/'), gav.artifactId(), gav.version(),\n        gav.artifactId() + \"-\" + gav.version() + \".pom\"));\n}","tryCatchPattern":"try {\n    ModelSource src = resolver.resolveModel(g, a, v);\n} catch (UnresolvableModelException e) {\n    // fall back to full MavenArtifactResolver (online) or report missing GAV e.getGroupId()/getArtifactId()/getVersion()\n}","preventionTips":["Never use LocalRepoModelResolver as the first resolver on a machine with a cold ~/.m2 cache","Pre-warm the local repo with mvn dependency:go-offline before offline builds","Validate GAV coordinates against Central before model building","In CI, cache ~/.m2/repository between runs"],"tags":["maven","local-repository","offline","pom-resolution"],"backgroundTag":"artifact-not-in-local-repository","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}