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

Bug 338867

Summary: Import wizard should only check the store once per "error".
Product: z_Archived Reporter: Pascal Rapicault <pascal>
Component: m2eAssignee: Matthew Piggott <matthew>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: igor, matthew
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Pascal Rapicault CLA 2011-03-03 17:48:29 EST
When I import a project using the wizard and the same "error" appears multiple times (e.g. unknown mojo), the store should only be checked one time. Currently it is being checked multiple times.
Comment 1 Igor Fedorenko CLA 2011-03-03 20:07:40 EST
This is not exactly true. Discovery service loads catalog items only once, then it processes all projects being imported without contacting the marketplace for each project.
Comment 2 Pascal Rapicault CLA 2011-03-03 20:38:07 EST
My original description was not very precise. What I actually saw (because there were resolution errors) is that the p2 resolver was being called for each entry. 
I noticed it because the plugin I was trying to install could not install and I could see the p2 message about computing explanation being displayed in the progress monitor.
I'm not quite sure where the root cause is but there is something fishy :)
Comment 3 Igor Fedorenko CLA 2011-03-04 09:42:36 EST
To make sure I understand, you are saying that m2e tried to install the same catalog item multiple times? This is certainly not expected. Please provide sample project and steps to reproduce the problem.
Comment 4 Pascal Rapicault CLA 2011-03-04 15:46:03 EST
- Clone aether
- Start eclipse selfhosted, Make sure that "support software installation" is not enabled. Make sure that plexus annotation support is not in the set of plugins
- Use the import wizard to import aether mentioned previously
- After seeing all the project, click next, some work is happening and you can see the p2 message about resolution being shown 4 times.
Comment 5 Igor Fedorenko CLA 2011-03-04 22:56:45 EST
From what I can tell, MavenDiscoveryInstallOperation gets run from LifecycleMappingPage.getNextPage, which does not make any sense. Not only LifecycleMappingPage.getNextPage is called rather frequently (as part of WizardDialog.updateButtons, for example), it is called before the user pressed Finish button. Adding Matt to CC as I obviously miss something important.
Comment 6 Igor Fedorenko CLA 2011-03-09 22:18:35 EST
I've changed the import wizard not to use any of copy&paste'ed p2 pages but instead run MavenDiscoveryInstallOperation after import wizard is finished. This results in somewhat ugly modal-wizard-on-top-of-modal-wizard GUI, but guarantees that p2 resolution happens only once and after the user has made all selections. I believe Properly behaving pretty GUI requires direct support of this use case from p2 ui.
Comment 7 Denis Roy CLA 2021-04-19 13:27:15 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/