Feature Request: Add jdt_maven_update_project tool #4

Closed
opened 2026-02-05 10:21:20 +00:00 by automation · 0 comments
Collaborator

Problem

When Maven POM files are modified (e.g., changing groupId, adding dependencies), the jdt_refresh_project tool only refreshes files from the filesystem but does not update Maven dependencies in Eclipse.

This results in "build path errors" that can only be resolved by manually running "Maven > Update Project" in Eclipse.

Proposed Solution

Add a new tool jdt_maven_update_project (or similar) that triggers the M2E "Update Project" functionality:

// Equivalent to: Right-click project → Maven → Update Project
IProjectConfigurationManager configManager = MavenPlugin.getProjectConfigurationManager();
configManager.updateProjectConfiguration(project, monitor);

Use Case

When using JDT MCP for refactoring that involves:

  • Moving types to new packages with different groupId
  • Adding/removing Maven dependencies
  • Changing artifact coordinates

The workflow would be:

  1. Edit pom.xml files
  2. Call jdt_maven_update_project
  3. Call jdt_refresh_project
  4. Continue with compilation error checks

Current Workaround

Users must manually update Maven projects in Eclipse IDE or run mvn install to work around this limitation.

## Problem When Maven POM files are modified (e.g., changing groupId, adding dependencies), the `jdt_refresh_project` tool only refreshes files from the filesystem but does not update Maven dependencies in Eclipse. This results in "build path errors" that can only be resolved by manually running "Maven > Update Project" in Eclipse. ## Proposed Solution Add a new tool `jdt_maven_update_project` (or similar) that triggers the M2E "Update Project" functionality: ```java // Equivalent to: Right-click project → Maven → Update Project IProjectConfigurationManager configManager = MavenPlugin.getProjectConfigurationManager(); configManager.updateProjectConfiguration(project, monitor); ``` ## Use Case When using JDT MCP for refactoring that involves: - Moving types to new packages with different groupId - Adding/removing Maven dependencies - Changing artifact coordinates The workflow would be: 1. Edit pom.xml files 2. Call `jdt_maven_update_project` 3. Call `jdt_refresh_project` 4. Continue with compilation error checks ## Current Workaround Users must manually update Maven projects in Eclipse IDE or run `mvn install` to work around this limitation.
fred closed this issue 2026-03-06 18:51:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ai-tools/jdt-mcp-server#4
No description provided.