Skip to content

localRepository in vscode not working #3811

@jqnote

Description

@jqnote

I defined in the .vscode/settings.json of the project

./.vscode/settings.json

{
"java.configuration.maven.userSettings": "${HOME}/.m2/settings-my.xml", 
"maven.executable.options": "-s ${HOME}/.m2/settings-my.xml"
}

settings-my.xml has a directory ${HOME}/mvn_repo defined in its localRepository.

However, the code hints in vscode's editor window keep showing that the classes present in the ${HOME}/mvn_repo directory cannot be found. It looks like the editor or the language server could not index the classes from the specified localRepository directory, what can I do?

Environment
  • Operating System: macos
  • JDK version: openjdk version "21.0.4" 2024-07-16 LTS
  • Visual Studio Code version: Version: 1.94.0 (Universal)
  • Java extension version: Extension Pack for Java v0.29.
Steps To Reproduce

${HOME}/.m2/settings-my.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
		  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
	<localRepository>${HOME}/mvn_repo</localRepository>
	<servers>
         ...
Current Result

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions