Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350136

Summary: Dependency is added to the wrong pom
Product: z_Archived Reporter: Julien HENRY <julien.henry>
Component: m2eAssignee: Milos Kleint <mkleint>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: fbricon, mkleint
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Julien HENRY CLA 2011-06-23 08:46:43 EDT
Build Identifier: 20110609-2236

When adding a dependency to a Maven project, the dependency is incorrectly added to the latest opened pom in the editor.

Reproducible: Always

Steps to Reproduce:
1. I have 2 Maven projects in my workspace.
2. Open the pom of project A in the editor
3. Right click on project B -> Maven -> Add dependency
4. Search a dependency in the dialog then OK
5. Dependency is added to project A !
Comment 1 Milos Kleint CLA 2011-06-23 12:36:31 EDT
the most likely culprit is MavenActionSupport.getPomFileFromPomEditorOrViewSelection()
Comment 2 Milos Kleint CLA 2011-06-27 03:16:31 EDT
http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=20333002e8e521f399d661449f4d05ba82447e2a

current selection needs to be processed primarily, the active editor is a relict of time when we had actions in main menu (and back even then it was wrong)
Comment 3 Denis Roy CLA 2021-04-19 13:26:04 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/