{"record":{"id":"03c4ca4a75a9c835","repo":"quarkusio/quarkus","slug":"failed-to-resolve-appartifact","errorCode":null,"errorMessage":"Failed to resolve ${appArtifact}","messagePattern":"Failed to resolve (.+?)","errorType":"exception","errorClass":"AppModelResolverException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/AppModelGradleResolver.java","lineNumber":121,"sourceCode":"        dep.setExtension(appArtifact.getType());\n        dep.setType(appArtifact.getType());\n        dep.setName(appArtifact.getArtifactId());\n        if (appArtifact.getClassifier() != null) {\n            dep.setClassifier(appArtifact.getClassifier());\n        }\n\n        final DefaultExternalModuleDependency gradleDep = new DefaultExternalModuleDependency(appArtifact.getGroupId(),\n                appArtifact.getArtifactId(), appArtifact.getVersion(), null);\n        gradleDep.addArtifact(dep);\n\n        final Configuration detachedConfig = project.getConfigurations().detachedConfiguration(gradleDep);\n\n        final ResolvedConfiguration rc = detachedConfig.getResolvedConfiguration();\n        Set<ResolvedArtifact> resolvedArtifacts;\n        try {\n            resolvedArtifacts = rc.getResolvedArtifacts();\n        } catch (ResolveException e) {\n            throw new AppModelResolverException(\"Failed to resolve \" + appArtifact, e);\n        }\n        for (ResolvedArtifact a : resolvedArtifacts) {\n            if (appArtifact.getArtifactId().equals(a.getName()) && appArtifact.getType().equals(a.getType())\n                    && (a.getClassifier() == null ? appArtifact.getClassifier() == null\n                            : a.getClassifier().equals(appArtifact.getClassifier()))\n                    && appArtifact.getGroupId().equals(a.getModuleVersion().getId().getGroup())) {\n                final String version = appArtifact.getVersion().equals(a.getModuleVersion().getId().getVersion())\n                        ? appArtifact.getVersion()\n                        : a.getModuleVersion().getId().getVersion();\n                return new ResolvedArtifactDependency(appArtifact.getGroupId(), appArtifact.getArtifactId(),\n                        appArtifact.getClassifier(), appArtifact.getType(), version, a.getFile().toPath());\n            }\n        }\n        throw new AppModelResolverException(\"Failed to resolve \" + appArtifact);\n    }\n\n    @Override\n    public Collection<ResolvedDependency> resolveUserDependencies(ArtifactCoords appArtifact,","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/AppModelGradleResolver.java#L103-L139","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the wrapped cause (getCause()) for the actual Gradle resolution failure (missing repo, 401/407, unknown artifact)","Verify the artifact coordinates (groupId/artifactId/version) exist and repositories are configured in the Gradle build","Run with --refresh-dependencies or check network/proxy settings; ensure ~/.gradle/caches is intact"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify coords exist before resolving: check repository metadata or cache\n// gradle dependencyInsight --dependency <artifactId>","typeGuard":null,"tryCatchPattern":"try { artifact = resolver.resolveArtifact(coords); } catch (AppModelResolverException e) { log.error(\"resolve failed for \" + coords, e.getCause()); }","preventionTips":["Verify coordinates against the repository before resolving","Ensure repositories are declared and reachable (proxy/VPN/offline state)","Use --refresh-dependencies when caches are suspect","Inspect the wrapped ResolveException cause"],"tags":["gradle","dependency-resolution","repository"],"backgroundTag":"dependency-resolution-failed","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"}