quarkusio/quarkus · error · UnresolvableModelException
Has not been previously resolved
Error message
Has not been previously resolved
What it means
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.
Source
Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/LocalRepoModelResolver.java:46
this.pomResolvers = pomResolvers;
}
@Override
public File resolvePom(String groupId, String artifactId, String version) {
for (LocalPomResolver pomResolver : pomResolvers) {
var pom = pomResolver.resolvePom(groupId, artifactId, version);
if (pom != null) {
return pom;
}
}
return null;
}
@Override
public ModelSource resolveModel(String groupId, String artifactId, String version) throws UnresolvableModelException {
var pomXml = resolvePom(groupId, artifactId, version);
if (pomXml == null) {
throw new UnresolvableModelException("Has not been previously resolved", groupId, artifactId, version);
}
return new ModelSource2() {
@Override
public InputStream getInputStream() throws IOException {
return new FileInputStream(pomXml);
}
@Override
public String getLocation() {
return pomXml.getAbsolutePath();
}
@Override
public ModelSource2 getRelatedSource(String relPath) {
return null;
}
@OverrideView on GitHub (pinned to e1c734241f)
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
Example fix
// before (offline resolve with empty ~/.m2) new ApplicationModelBuilder().setOffline(true).resolve(); // after mvn dependency:go-offline // then run offline resolve
Defensive patterns
Strategy: try-catch
Validate before calling
File pom = new File(localRepo, g/artifactId + "/" + version + "/" + artifactId + "-" + version + ".pom");
if (!pom.isFile()) { /* resolve online first or fail fast */ } Type guard
boolean isCached(GAV gav) {
return java.nio.file.Files.isRegularFile(java.nio.file.Path.of(
System.getProperty("user.home"), ".m2", "repository",
gav.groupId().replace('.', '/'), gav.artifactId(), gav.version(),
gav.artifactId() + "-" + gav.version() + ".pom"));
} Try / catch
try {
ModelSource src = resolver.resolveModel(g, a, v);
} catch (UnresolvableModelException e) {
// fall back to full MavenArtifactResolver (online) or report missing GAV e.getGroupId()/getArtifactId()/getVersion()
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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).
Related errors
- An error occurred attempting to resolve effective POM
- Failed to install ${artifact}
- Failed to resolve ${coords} locally
- Unable to determine groupId and artifactId of the jar that c
- Unable to determine groupId and artifactId of the extension
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/949b7e3d5c37623a.
Report an issue: GitHub.