quarkusio/quarkus · error · AppModelResolverException

Failed to resolve ${appArtifact}

Error message

Failed to resolve ${appArtifact}

What it means

Thrown when Gradle's detached configuration resolution fails while resolving an artifact's file. The underlying ResolveException from Gradle is wrapped into an AppModelResolverException naming the artifact.

Source

Thrown at devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/AppModelGradleResolver.java:121

        dep.setExtension(appArtifact.getType());
        dep.setType(appArtifact.getType());
        dep.setName(appArtifact.getArtifactId());
        if (appArtifact.getClassifier() != null) {
            dep.setClassifier(appArtifact.getClassifier());
        }

        final DefaultExternalModuleDependency gradleDep = new DefaultExternalModuleDependency(appArtifact.getGroupId(),
                appArtifact.getArtifactId(), appArtifact.getVersion(), null);
        gradleDep.addArtifact(dep);

        final Configuration detachedConfig = project.getConfigurations().detachedConfiguration(gradleDep);

        final ResolvedConfiguration rc = detachedConfig.getResolvedConfiguration();
        Set<ResolvedArtifact> resolvedArtifacts;
        try {
            resolvedArtifacts = rc.getResolvedArtifacts();
        } catch (ResolveException e) {
            throw new AppModelResolverException("Failed to resolve " + appArtifact, e);
        }
        for (ResolvedArtifact a : resolvedArtifacts) {
            if (appArtifact.getArtifactId().equals(a.getName()) && appArtifact.getType().equals(a.getType())
                    && (a.getClassifier() == null ? appArtifact.getClassifier() == null
                            : a.getClassifier().equals(appArtifact.getClassifier()))
                    && appArtifact.getGroupId().equals(a.getModuleVersion().getId().getGroup())) {
                final String version = appArtifact.getVersion().equals(a.getModuleVersion().getId().getVersion())
                        ? appArtifact.getVersion()
                        : a.getModuleVersion().getId().getVersion();
                return new ResolvedArtifactDependency(appArtifact.getGroupId(), appArtifact.getArtifactId(),
                        appArtifact.getClassifier(), appArtifact.getType(), version, a.getFile().toPath());
            }
        }
        throw new AppModelResolverException("Failed to resolve " + appArtifact);
    }

    @Override
    public Collection<ResolvedDependency> resolveUserDependencies(ArtifactCoords appArtifact,

View on GitHub (pinned to e1c734241f)

Solutions

  1. Inspect the wrapped cause (getCause()) for the actual Gradle resolution failure (missing repo, 401/407, unknown artifact)
  2. Verify the artifact coordinates (groupId/artifactId/version) exist and repositories are configured in the Gradle build
  3. Run with --refresh-dependencies or check network/proxy settings; ensure ~/.gradle/caches is intact
Defensive patterns

Strategy: try-catch

Validate before calling

// verify coords exist before resolving: check repository metadata or cache
// gradle dependencyInsight --dependency <artifactId>

Try / catch

try { artifact = resolver.resolveArtifact(coords); } catch (AppModelResolverException e) { log.error("resolve failed for " + coords, e.getCause()); }

Prevention

When it happens

Trigger: resolveArtifact calls rc.getResolvedArtifacts() on a detached configuration built from the artifact coordinates, and Gradle throws ResolveException — typically a repository/network failure or unresolvable dependency constraint.

Common situations: Offline builds with no cached artifact, wrong repository configured in build.gradle/settings.gradle, invalid or non-existent coordinates/version, corporate proxy blocking Maven Central.

Related errors


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