Skip to content

JDTLS spawns separate process per module in Java Maven multi-module projects #28760

Description

@areyouok

Description

In a Maven multi-module project (parent pom.xml with <modules>), JDTLS spawns a separate process for each submodule instead of sharing a single instance at the topmost parent pom.xml.

For example, with this structure:

project-root/
  pom.xml              (parent, declares <modules>)
  module-a/pom.xml     (child module)
  module-b/pom.xml     (child module)

Opening Java files in module-a and module-b each starts a separate JDTLS process. Each JDTLS instance uses ~1GB, so a project with 5+ modules easily consumes 5GB+ of memory.

The existing fix (#14192) resolved this for Gradle monorepos by walking up to find settings.gradle. However, Maven multi-module projects were not addressed — the root detection still falls back to the nearest pom.xml for Maven projects.

Steps to reproduce

  1. Create a Maven multi-module project with a parent pom.xml and 3+ child modules
  2. Open Java files from different modules in opencode
  3. Observe multiple JDTLS processes via ps aux | grep jdtls

Operating System

macOS 26.4 (aarch64)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions