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
{{ message }}
Repository navigation
Maven project 5 folders deap are not loaded as java projects #4364
Describe the bug
I have a repository with java projects spread throughout. Some 5 folders deep. I've noticed that my deep folder java projects aren't loaded. The "Maven" view shows the pom, but the "Java Projects" does not show the projects as loaded.
If I move the project one level up (4 levels deep) then the project is detected and loaded.
This one's an off-by-one bug in the scanner JDTLS uses to auto-discover build files (BasicFileDetector).
When java.import.projectSelection is automatic (the default), the server hunts for pom.xml files by walking your workspace with Files.walkFileTree(..., maxDepth, ...), and maxDepth is 5. The catch: the pom.xml check only happens in preVisitDirectory, but walkFileTree never actually opens the folders sitting exactly at maxDepth — those get handed off to visitFile instead. So a project folder exactly 5 levels deep just gets skipped, while 4 levels deep sails through. (The Maven view finds your pom on its own, which is why it still shows up there.)
I grabbed your sample (1/2/3/4/test/pom.xml) and confirmed it: maxDepth=5 finds nothing, bump it to 6 and it shows up. The fix is to also check the folders that land on the depth boundary in visitFile. PR on the way.
Activity
chagong commentedon Jun 12, 2026
This one's an off-by-one bug in the scanner JDTLS uses to auto-discover build files (
BasicFileDetector).When
java.import.projectSelectionisautomatic(the default), the server hunts forpom.xmlfiles by walking your workspace withFiles.walkFileTree(..., maxDepth, ...), andmaxDepthis5. The catch: thepom.xmlcheck only happens inpreVisitDirectory, butwalkFileTreenever actually opens the folders sitting exactly atmaxDepth— those get handed off tovisitFileinstead. So a project folder exactly 5 levels deep just gets skipped, while 4 levels deep sails through. (The Maven view finds your pom on its own, which is why it still shows up there.)I grabbed your sample (
1/2/3/4/test/pom.xml) and confirmed it:maxDepth=5finds nothing, bump it to6and it shows up. The fix is to also check the folders that land on the depth boundary invisitFile. PR on the way.fix: detect build files located exactly at maxDepth
fix: detect build files located exactly at maxDepth