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

Bug 341059

Summary: Archetype properties are not set in the Maven Module wizard
Product: z_Archived Reporter: Fred Bricon <fbricon>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: igor, matthew
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch to add archetype properties in the Module Wizard none

Description Fred Bricon CLA 2011-03-27 12:47:19 EDT
If you try to create a maven module from an archetype requiring properties, these properties are not displayed in the Archetype Parameters page, resulting in a crash when finish the module creation.

Steps to reproduce :
- create a pom project
- on the pom project, create a new maven module 
- in the wizard, set the name of the module, click next
- choose the org.jboss.weld.archetypes:jboss-javaee6-webapp click next
- There should be a "name" parameter available from the archetype, with the value "Java EE 6 webapp project". Instead no parameters are displayed
- after setting groupid/version/package, click next -> a popup window displays an error message "Unable to create project from archetype [org.jboss.weld.archetypes:jboss-javaee6-webapp:1.0.1.Beta2], an underlying popup gives more details on the error : "Unable to create project from archetype [org.jboss.weld.archetypes:jboss-javaee6-webapp:1.0.1.Beta2]
Archetype org.jboss.weld.archetypes:jboss-javaee6-webapp:1.0.1.Beta2 is not configured
	Property name is missing."

Turns out the following code, present in MavenProjectWizard, is missing in MavenModuleWizard.createPageControls(Composite pageContainer) : 

{code}
    archetypePage.addArchetypeSelectionListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent selectionchangedevent) {
        parametersPage.setArchetype(archetypePage.getArchetype());
        getContainer().updateButtons();
      }
    });
{code}
Comment 1 Fred Bricon CLA 2011-03-27 13:07:27 EDT
On a semi-related note, the finish button is enabled too early in the Maven Module page, so the aforementioned error occurs too when clicking on Finish, right after selecting the archetype, even when applying the fix from my last comment. It should be disabled on the archetype selection page, similarly to the Maven Project Wizard.

I'll post a patch if I can get a proper fix.
Comment 2 Fred Bricon CLA 2011-05-11 15:46:44 EDT
Created attachment 195418 [details]
Patch to add archetype properties in the Module Wizard

Please review / apply the fix.
Comment 3 Matthew Piggott CLA 2011-05-12 13:25:38 EDT
+1 

I reviewed the patch and don't see a problem with it.  I was also able to confirm the behaviour before & after applying the patch.
Comment 4 Igor Fedorenko CLA 2011-05-12 13:28:22 EDT
Applied the patch. Thank you.
Comment 5 Denis Roy CLA 2021-04-19 13:22:18 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/