{"record":{"id":"edbdb51da28d30e9","repo":"quarkusio/quarkus","slug":"failed-to-intialize-the-default-maven-artifact-res","errorCode":null,"errorMessage":"Failed to intialize the default Maven artifact resolver","messagePattern":"Failed to intialize the default Maven artifact resolver","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/ExtensionCatalogResolver.java","lineNumber":107,"sourceCode":"            buildRegistryClients();\n            return ExtensionCatalogResolver.this;\n        }\n\n        private void completeConfig() {\n            if (config == null) {\n                config = RegistriesConfigLocator.resolveConfig();\n            }\n            if (log == null) {\n                log = config.isDebug() ? MessageWriter.debug() : MessageWriter.info();\n            }\n            if (artifactResolver == null) {\n                try {\n                    artifactResolver = MavenArtifactResolver.builder()\n                            .setWorkspaceDiscovery(false)\n                            .setArtifactTransferLogging(config.isDebug())\n                            .build();\n                } catch (BootstrapMavenException e) {\n                    throw new IllegalStateException(\"Failed to intialize the default Maven artifact resolver\", e);\n                }\n            }\n        }\n\n        private void buildRegistryClients() throws RegistryResolutionException {\n            registries = new ArrayList<>(config.getRegistries().size());\n            for (RegistryConfig config : config.getRegistries()) {\n                if (!config.isEnabled()) {\n                    continue;\n                }\n                final RegistryClientFactory clientFactory = getClientFactory(config);\n                registries\n                        .add(new RegistryExtensionResolver(clientFactory.buildRegistryClient(config), log));\n            }\n        }\n\n        private RegistryClientFactory getClientFactory(RegistryConfig config) {\n            if (config.getExtra().isEmpty()) {","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/ExtensionCatalogResolver.java#L89-L125","documentation":"Thrown by ExtensionCatalogResolver's config-completion step when building the default MavenArtifactResolver fails with a BootstrapMavenException. This means the embedded Maven resolver could not be initialized — usually invalid Maven settings, a broken local repository, or unresolvable settings configuration.","triggerScenarios":"Calling build() on an ExtensionCatalogResolver with no custom artifact resolver, where MavenArtifactResolver.builder()...build() throws because settings.xml is invalid, the local repo path is bad, or Maven profile/property resolution fails.","commonSituations":"Malformed ~/.m2/settings.xml; invalid mirror/repository URLs; unreadable or corrupted local repository; MAVEN_OPTS/-Dmaven.* flags conflicting; missing MAVEN_HOME settings resolution.","solutions":["Validate ~/.m2/settings.xml parses and has valid URLs (mvn help:effective-settings)","Check the error's cause for the exact settings element that failed","Fix or temporarily rename settings.xml to isolate the problem","Ensure the local Maven repository path exists and is writable"],"exampleFix":"// before: settings.xml\n<mirror><url>htp:/bad-url</url></mirror>\n// after\n<mirror>\n  <id>central</id>\n  <url>https://repo.maven.apache.org/maven2</url>\n  <mirrorOf>central</mirrorOf>\n</mirror>","handlingStrategy":"validation","validationCode":"// Validate Maven settings before building the resolver\nPath settings = Path.of(System.getProperty(\"user.home\"), \".m2\", \"settings.xml\");\nif (Files.exists(settings)) {\n    new XmlSlurper().parse(settings.toFile()); // or SAXParser: throws if malformed\n}","typeGuard":null,"tryCatchPattern":"try {\n    resolver.build();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"Failed to intialize the default Maven artifact resolver\")) {\n        // inspect e.getCause() (BootstrapMavenException) for the offending settings element\n    }\n    throw e;\n}","preventionTips":["Keep ~/.m2/settings.xml well-formed; run mvn help:effective-settings as a smoke test","Avoid pointing localRepository at nonexistent or read-only paths","Test resolver construction in CI before depending on it"],"tags":["maven","configuration","initialization"],"backgroundTag":"maven-settings-invalid","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"}