{"record":{"id":"3795c2087ab04aac","repo":"quarkusio/quarkus","slug":"failed-to-resolve-application-model-appartifact-3795c2","errorCode":null,"errorMessage":"Failed to resolve application model <appArtifact> dependencies","messagePattern":"Failed to resolve application model <appArtifact> dependencies","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/DependencyTreeMojo.java","lineNumber":164,"sourceCode":"                    modelResolver.setTest(true);\n                } else if (mode.equalsIgnoreCase(\"dev\") || mode.equalsIgnoreCase(\"development\")) {\n                    modelResolver.setDevMode(true);\n                } else if (mode.equalsIgnoreCase(\"prod\") || mode.isEmpty()) {\n                    // ignore, that's the default\n                } else {\n                    throw new MojoExecutionException(\n                            \"Parameter 'mode' was set to '\" + mode + \"' while expected one of 'dev', 'test' or 'prod'\");\n                }\n            }\n            modelResolver.setLegacyModelResolver(BootstrapAppModelResolver.isLegacyModelResolver(project.getProperties()));\n            modelResolver.setDepLogConfig(DependencyLoggingConfig.builder()\n                    .setMessageConsumer(log)\n                    .setVerbose(verbose)\n                    .setGraph(graph)\n                    .build());\n            modelResolver.resolveModel(appArtifact);\n        } catch (Exception e) {\n            throw new MojoExecutionException(\"Failed to resolve application model \" + appArtifact + \" dependencies\", e);\n        }\n    }\n\n    protected MavenArtifactResolver resolver() {\n        return resolver == null\n                ? resolver = workspaceProvider.createArtifactResolver(BootstrapMavenContext.config()\n                        .setUserSettings(session.getRequest().getUserSettingsFile())\n                        // The system needs to be initialized with the bootstrap model builder to properly interpolate system properties set on the command line\n                        // e.g. -Dquarkus.platform.version=xxx\n                        //.setRepositorySystem(repoSystem)\n                        // The session should be initialized with the loaded workspace\n                        //.setRepositorySystemSession(repoSession)\n                        .setRemoteRepositories(repos)\n                        // To support multi-module projects that haven't been installed\n                        .setPreferPomsFromWorkspace(true))\n                : resolver;\n    }\n}","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/DependencyTreeMojo.java#L146-L182","documentation":"After configuring a model resolver, DependencyTreeMojo calls modelResolver.resolveModel(appArtifact) to compute the application's dependency model. Any exception during resolution (missing artifacts, bad POM, repository access problems) is wrapped in MojoExecutionException with this message and the failing artifact coordinates.","triggerScenarios":"Resolving the application model for a project whose dependencies cannot be downloaded (offline mode, unreachable repository), a corrupt/invalid pom.xml, a missing local workspace module, or a snapshot artifact that no longer exists in the remote repo.","commonSituations":"Corporate proxy or VPN blocking Maven Central; internal repository credentials missing from settings.xml; SNAPSHOT dependency purged from remote; reactor module not built/installed before running the goal; malformed dependency declaration in pom.xml.","solutions":["Run `mvn install -DskipTests` on the reactor first so local modules are available in the local repository.","Check network/proxy settings and verify repository credentials in ~/.m2/settings.xml (run with -e to see the root cause).","Refresh/repair the local repository cache: delete the failing artifact directory under ~/.m2/repository and rebuild, or run with -U.","Fix malformed dependency or repository declarations in the project pom.xml."],"exampleFix":"// before (offline, module never installed)\nmvn quarkus:dependency-tree -o\n// after\nmvn install -DskipTests && mvn quarkus:dependency-tree","handlingStrategy":"try-catch","validationCode":"// pre-flight: make sure the reactor is installed and network is available\nmvn install -DskipTests\nmvn dependency:resolve -U","typeGuard":null,"tryCatchPattern":"// handle the wrapped MojoExecutionException and inspect the cause\ntry {\n    // run quarkus:dependency-tree\n} catch (MojoExecutionException e) {\n    Throwable root = e;\n    while (root.getCause() != null) root = root.getCause();\n    log.error(\"Model resolution failed: \" + root.getMessage());\n}","preventionTips":["Run mvn install on the reactor before running the goal.","Keep settings.xml proxy/repository credentials correct.","Run with -U periodically to refresh stale metadata.","Avoid referencing SNAPSHOTs that may vanish from remotes."],"tags":["maven","dependency-resolution","network","quarkus"],"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-12T22:17:10.623Z"}