vscode-maven icon indicating copy to clipboard operation
vscode-maven copied to clipboard

Automatically import pom.xml if .java source code is opened in editor

Open dsyer opened this issue 3 years ago • 2 comments

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).

dsyer avatar Oct 20 '21 09:10 dsyer

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.

Eskibear avatar Oct 20 '21 13:10 Eskibear

/cc @jdneo who is working on related improvements.

Eskibear avatar Oct 20 '21 13:10 Eskibear