2 same modules in New Project/Module Wizard
Hello!
I am trying to create a module group with one module in New Project/Module Wizard, but I am getting 2 same modules in my module group. My createTemplates method looks like this:
public ProjectTemplate[] createTemplates(String group, WizardContext context) {
return new ProjectTemplate[]{
new BuilderBasedTemplate(new PerfCakeModuleBuilder()),
};
}
It has a ProjectTemplate with just one Template, so why there is another module created in my module group? And how can I get rid of it? Thanks.
Please sign in to leave a comment.
Hello,
Could you please check that your ProjectTemplatesFactory isn't registered twice in plugin.xml (<projectTemplatesFactory/> extension point)?
Sergey
Thank you for the answer. In plugin.xml I have:
When I remove projectTemplatesFactory I will have just one module in the Wizard, but in group Other (I want my own group with one module)
When I remove moduleType, Intellij screams there is unknown UnknownModuleType.
I think that there is some default module created. I have just implemented ModuleType, JavaModuleBuilder and ProjectTemplateFactory class. Also when I add ModuleBuilder in plugin.xml then it shows even another module in the Wizard (so 3 same modules together).
How it should look like to have just 1 module in my own category in the wizard?
Hey, I too tried out what you have mentioned above, and got the same output. The Module gets repeated twice in the group. Well, then I removed the "projectTemplatesFactory" from plugin.xml and instead added another ModuleBuilder.
And I overrided the getGroupName() in both of them.
And now, I get both the builders in a group "Game". So, instead of one module getting repeated twice, I have two unique modules with different wizard settings. [This is kind of what I was looking for in the first place].
So, I guess that, in Intellij IDEA, you need to have two or more module type to have a Group... If anyone could provide clarity on this one, it would be really helpful.
Look at com.intellij.ide.projectWizard.ProjectTypeStep#fillTemplatesMap()
This is where the groups are computed.
Old post, but there isn't much information available. I wanted to use ProjectTemplatesFactory instead of registering multiple ModuleBuilders. So what worked for me to have only one module in the wizard, was that I added to my ModuleBuilder