Adding a project template

I'm trying to write a plugin that (for now) just adds a template to the "New Project" dialog.  This is all I have so far in my project.xml, and it doesn't seem to be working.

...
<extensions defaultExtensionNs="com.intellij">
    <projectTemplate projectType="Java" templatePath="resources/projectTemplates/Java/Sample.zip"
                     category="true"/>

</extensions>
...


Absolutely nothing changes.  There's no option to create my template.  I know the plugin is running, since it actually does other things, but I can't figure out how to add a project template.  I'm assuming I have to implement some interface, but I can't find which one.  Any suggestions?

10 comments
Comment actions Permalink

I think you need to set the category attribute to false. Your current code registers a project template category which doesn't contain any templates and is therefore not shown in the UI.

0
Comment actions Permalink

Nope, still nothing.

0
Comment actions Permalink

Could you please check that the .zip extension is matched by the resource patterns in Settings | Compiler?

0
Comment actions Permalink

It is.  Still nothing.


0
Comment actions Permalink

As far as I can see the correct projectType value for a regular Java application is "JAVA_MODULE", not "Java".

0
Comment actions Permalink

Still no change.


0
Comment actions Permalink

What's the contents of your Sample.zip? In particular, does it contain .idea/description.html and .idea/project-template.xml?

0
Comment actions Permalink

Thanks for the response.  Here's my project template.  I believe it has everything required, although I'm having a hard time finding documentation on manually creating project templates, so I just looked at what was in the default ones.



Attachment(s):
Sample_Robot.zip
0
Comment actions Permalink

This looks correct as far as I can tell.

Are there any exceptions in idea.log when you start IDEA with your plugin and open the new project wizard?

Is the full code of your plugin available somewhere?

0
Comment actions Permalink

 hi,Thomas Clark

i met the same issue, could you give me some help about above question, thanks a lot !

0

Please sign in to leave a comment.