{"record":{"id":"80042022300e6fc8","repo":"oraios/serena","slug":"provided-maven-settings-file-not-found-custom-ma","errorCode":null,"errorMessage":"Provided maven settings file not found: {custom_maven_settings_path}. Fix: create the file, update path in ~/.serena/serena_config.yml (ls_specific_settings -> java -> maven_user_settings), or remove the setting to use default ({default_maven_settings_path})","messagePattern":"Provided maven settings file not found: (.+?)\\. Fix: create the file, update path in ~/\\.serena/serena_config\\.yml \\(ls_specific_settings -> java -> maven_user_settings\\), or remove the setting to use default \\((.+?)\\)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/eclipse_jdtls.py","lineNumber":922,"sourceCode":"        # Look into https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java to understand all the options available\n\n        repo_uri = pathlib.Path(self.repository_root_path).as_uri()\n\n        # Load user's Maven and Gradle configuration paths from ls_specific_settings[\"java\"]\n\n        # Maven settings: default to ~/.m2/settings.xml\n        default_maven_settings_path = os.path.join(os.path.expanduser(\"~\"), \".m2\", \"settings.xml\")\n        custom_maven_settings_path = self._custom_settings.get(\"maven_user_settings\")\n        if custom_maven_settings_path is not None:\n            # User explicitly provided a path\n            if not os.path.exists(custom_maven_settings_path):\n                error_msg = (\n                    f\"Provided maven settings file not found: {custom_maven_settings_path}. \"\n                    f\"Fix: create the file, update path in ~/.serena/serena_config.yml (ls_specific_settings -> java -> maven_user_settings), \"\n                    f\"or remove the setting to use default ({default_maven_settings_path})\"\n                )\n                log.error(error_msg)\n                raise FileNotFoundError(error_msg)\n            maven_settings_path = custom_maven_settings_path\n            log.info(f\"Using Maven settings from custom location: {maven_settings_path}\")\n        elif os.path.exists(default_maven_settings_path):\n            maven_settings_path = default_maven_settings_path\n            log.info(f\"Using Maven settings from default location: {maven_settings_path}\")\n        else:\n            maven_settings_path = None\n            log.info(f\"Maven settings not found at default location ({default_maven_settings_path}), will use JDTLS defaults\")\n\n        # Gradle user home: default to ~/.gradle\n        default_gradle_home = os.path.join(os.path.expanduser(\"~\"), \".gradle\")\n        custom_gradle_home = self._custom_settings.get(\"gradle_user_home\")\n        if custom_gradle_home is not None:\n            # User explicitly provided a path\n            if not os.path.exists(custom_gradle_home):\n                error_msg = (\n                    f\"Gradle user home directory not found: {custom_gradle_home}. \"\n                    f\"Fix: create the directory, update path in ~/.serena/serena_config.yml (ls_specific_settings -> java -> gradle_user_home), \"","sourceCodeStart":904,"sourceCodeEnd":940,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/eclipse_jdtls.py#L904-L940","documentation":"Serena lets you point JDTLS at a custom Maven settings.xml via ls_specific_settings.java.maven_user_settings in ~/.serena/serena_config.yml. When that configured file does not exist, _create_base_initialize_params raises FileNotFoundError so dependency resolution doesn't silently run with defaults. The message lists the default path that would be used instead.","triggerScenarios":"Starting the JDTLS language server with a maven_user_settings value in serena_config.yml whose file path does not exist — wrong filename, file deleted, or relative path resolved differently than expected.","commonSituations":"Copying a settings.xml path from another machine; deleting ~/.m2/settings.xml or a corporate settings file during cleanup; typo like 'setting.xml' instead of 'settings.xml'; mount not present in CI.","solutions":["Create the settings file at the configured path (e.g., copy a template or your corporate settings.xml)","Update ls_specific_settings -> java -> maven_user_settings in ~/.serena/serena_config.yml to the correct path","Or remove the maven_user_settings key entirely so the default (~/.m2/settings.xml) is used","Run ls -l <configured path> to confirm the exact file exists"],"exampleFix":"# before (serena_config.yml)\nmaven_user_settings: /home/user/.m2/setting.xml   # typo\n// after\nmaven_user_settings: /home/user/.m2/settings.xml\n","handlingStrategy":"validation","validationCode":"import os, yaml\ncfg = yaml.safe_load(open(os.path.expanduser('~/.serena/serena_config.yml')))\np = cfg.get('ls_specific_settings', {}).get('java', {}).get('maven_user_settings')\nif p and not os.path.isfile(os.path.expanduser(p)):\n    print(f\"maven settings file missing: {p}\")","typeGuard":"def maven_settings_ok(path: str | None) -> bool:\n    import os\n    return path is None or os.path.isfile(os.path.expanduser(path))","tryCatchPattern":"try:\n    server = LanguageServer.create(LanguageServerId.JAVA, ...)\nexcept FileNotFoundError as e:\n    logger.error(\"Maven settings issue: %s\", e)\n    # remove maven_user_settings from config or create the file, then retry","preventionTips":["Verify the settings.xml path right after editing serena_config.yml","Use absolute, expanded paths (~/...) in config","Don't delete corporate settings.xml without updating the config","Keep a template settings.xml committed for CI environments"],"tags":["java","maven","file-not-found","configuration"],"backgroundTag":"config-path-not-found","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}