Closed sairaghavak closed 1 week ago
@sairaghavak You can try the following settings:
"java.import.exclusions": [
"**/node_modules/**",
"**/.metadata/**",
"**/archetype-resources/**",
"**/META-INF/maven/**",
"**/sb1-maven-java11"
],
and clean the workspace directory:
Java: Clean the Java Language Server Workspace
Restart and delete
from the confirmation promptThis works. Which folder does Java language server cleans?
The cache folder for the language server is cleaned.
And there is another approach you can use when you want to import part of the maven sub-modules.
You can set the setting java.import.projectSelection
to manual
. And the trigger the command Java: import Java Projects into workspace
, and select the folder you want to import. In this way, you do not need to set the "java.import.exclusions"
in the workspace level.
Can this be closed now ?
If you ever did want to import the project but just suppress the errors/warnings, we also recently added :
java.diagnostic.filter
: Specifies a list of file patterns for which matching documents should not have their diagnostics reported (eg. '**/Foo.java').
However, in this case excluding the prompt from import seems like the right aproach.
Close and please leave comment if you have more query
I have 2 java projects
sb1-maven-java11
sb2-maven-java11
under one workspace. I have some compiler issues in one of the java project saysb1-maven-java11
, so I have disabled that project from file explorer using the following settingand also excluded it in files watcher
Also disabled under maven setting so that it's not scanned/recognized by maven view
But the problem is when I reload the Vscode window, the excluded project is still built during startup by Java language server and the compiler errors are reported under
problems
view.Environment
Steps To Reproduce
A
,B
or as you wish.A
just to have compiler error. Now, try to excludeA
as mentioned in my issue description with maven settings and file exclude settingCurrent Result
The compiler errors in project
A
are reported under problems view though that folder is excluded in project view and maven view.Expected Result
I think it should be ignored by JavaLanguage Server from building that excluded project and stop reporting the problems(Compiler errors, Warnings) related to that project.
Or may be if there is any specific setting already to achieve this of ignoring a specific Java project from building could help resolve this issue.