You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to search the existing issues and could not find this particular issue discussed anywhere. If I open VS Code with a simple Maven project (single pom.xml, no sub-modules) and there are Gradle projects existing within the target folder then the maven project is not detected and its dependencies and source folders are not added to the Java source paths list.
To fix the issue I must run a mvn clean on the project and clean the language server workspace for the maven project to be detected. Afterwards I can build and restart and everything works as expected (and the gradle projects are added to the source list along with the maven projects) as long as I don't clean the workspace and restart without cleaning the maven target folder as well.
Took me several hours to track down why the project stopped working so hopefully I can save someone else from that frustration.
Environment
Operating System: Windows 10 Pro
JDK version: OpenJDK 1.8
Visual Studio Code version: 1.43.2
Java extension version: 0.59.0-2069
Steps To Reproduce
Open VS Code and load sample-test folder
Wait for Java Language Server to finish loading
Run command List all Java source paths
Note 5 maven project paths listed
Run mvn package
If you restart VS Code now and list source paths you should see the 5 maven paths and 2 new gradle paths
Clean the Java Language Server Workspace and restart VS Code
Wait for Java Language Server to finish loading and run command List all Java source paths
Note that only 2 gradle paths are listed, the maven paths do not load
Thanks @snjeza, it looks like setting those exclusions does the trick and intellisense is maintained as long as my .classpath is setup correctly. I still think this is a bug that should be addressed as it doesn't make sense to behave differently in the two scenarios, but this workaround is sufficient in the meantime. Not sure how you all want to handle this ticket.
I tried to search the existing issues and could not find this particular issue discussed anywhere. If I open VS Code with a simple Maven project (single pom.xml, no sub-modules) and there are Gradle projects existing within the target folder then the maven project is not detected and its dependencies and source folders are not added to the Java source paths list.
To fix the issue I must run a
mvn clean
on the project and clean the language server workspace for the maven project to be detected. Afterwards I can build and restart and everything works as expected (and the gradle projects are added to the source list along with the maven projects) as long as I don't clean the workspace and restart without cleaning the maven target folder as well.Took me several hours to track down why the project stopped working so hopefully I can save someone else from that frustration.
Environment
Steps To Reproduce
List all Java source paths
mvn package
List all Java source paths
sample-test.zip
Current Result
Maven paths do not load if gradle paths are found in subfolders
Expected Result
Both maven paths and gradle paths should load correctly, regardless of additional projects found in subfolders.
Additional Informations
Seems related to #600
The text was updated successfully, but these errors were encountered: