vscode-maven
vscode-maven copied to clipboard
Automatically import pom.xml if .java source code is opened in editor
VSCode never generates .project
and .classpath
for the pom.xml
files that are not wired up to the reactor build at the root (e.g. where there are standalone samples). I'm not sure it would be a good experience to always eagerly scan all directories for pom.xml
and generate on startup, but it probably would be a good experience to do it on demand, e.g. when a .java source file is opened in an editor. AFAIK there is no way to force the metadata to be generated, except by opening the subdirectory as a top level project (it doesn't work to add it to the workspace of the top level directory).
These files are not generated by VS Code Maven extension, but by Java extension.
See https://github.com/redhat-developer/vscode-java/issues/618 and a WIP improvement https://github.com/eclipse/eclipse.jdt.ls/pull/1900
As for which projects to import, an ideal approach is to let user decide what to import. And that's also on the backlog of Java extension.
/cc @jdneo who is working on related improvements.