New Project using project-template.zip

Answered

Hello everyone,

I have an issues with my plugin since the Intellij version 2022.1. 
When I try to create a new project 

I have implement a ModuleBuilder and a ModuleType. Furthermore  I provide a Template (see below).

 

When I click on create new Project the project will be created with a .idea folder and a .iml file but the project-structure defined by template zip is not generated. 

Before version 2022.1 I was able to choose a template in the new project wizard (see below).

With Version 2021.3.3

plugin.xml

<extensions defaultExtensionNs="com.intellij">

<moduleType id="FIRE_MODULE" implementationClass="de.adesso.fire.modelerui.module.FireModuleType"/>
<!-- Import ProjectTemplates -->
<projectTemplate projectType="FIRE_MODULE" templatePath="projectTemplates/Empty_Configuration_Project.zip" category="false"/>

</extensions>

I created a small example which you can use for testing.
Upload id: 2022_06_01_9Fk3Hqme4TYDsfpJ (file: intellij_plugin_development.zip)

 

18 comments
Comment actions Permalink

Hi Pascal,

I'm not sure if I understand your issue. I downloaded and opened your project. I can see that one of the templates is configured. I executed the runIde task with the existing configuration (2021.1.3) and was able to select your template and the project was generated. Files are not visible, because there is no module configuration in your template.

When I change the version to 2022.1 and execute runIde, I can't see your project in the new project window.

Please clarify what is the actual issue and please describe the exact steps we have to perform to reproduce it, ideally with screenshots of the error and a clear description what is the issue.

0
Comment actions Permalink

Hi Karol,
I just want to see my project in the project wizard like version 2021.1.3. I do not understand why the project is not visible in version 2022.1.

I have another question. Do you have a documentation about how to to configure a module?

0
Comment actions Permalink

Hi Pascal,

Just wondering if your ModuleBuilder extends 

com.intellij.ide.util.projectWizard.ModuleBuilder;

 

0
Comment actions Permalink

Hi Karol,

I am also facing exactly the same problem. (IntelliJ IDEA 2022.2.1 (Community Edition))

In the new project wizard, post choosing the project from the lefthand side (Screen1.jpg attached) and clicking the next button, is showing Project name and location screen (Screen2.jpg attached).

However, I am not seeing screen to select the project template.

Please let me know what I am missing here.

<extensions defaultExtensionNs="com.intellij">
<!-- Add your extensions here -->
<moduleType id="EKAM_MODULE" implementationClass="com.testvagrant.ekam.EkamModuleType"/>
<moduleBuilder builderClass="com.testvagrant.ekam.EkamModuleBuilder"/>
<projectTemplate projectType="EKAM_MODULE" templatePath="/META-INF/ekam-template.zip"/>

</extensions>

 

0
Comment actions Permalink

Hello Pani,

yes my ModuleBuilder extends 

com.intellij.ide.util.projectWizard.ModuleBuilder;

I did found another option to implement my project. I am using the `New File` Option to genereate a file which automaticaly genereate the project structure. But if you has got a better solution let me know. 

0
Comment actions Permalink

Hello Pascal,

Unfortunately, that approach does not work for me.
Karol Lewandowski I feel the project template capability is broken after 2022.1 release. Your help and input would be great. 

0
Comment actions Permalink

Hi Pani,

Could you please share your plugin sources, so I can take a look?

I can't find it in https://github.com/orgs/testvagrant/repositories?type=all

0
Comment actions Permalink

Hello Karol Lewandowski

Just wondering if we're able to access the code shared. Let me know if you need any further details from my end

0
Comment actions Permalink

Hi Pani,

Yes, I can access it, thanks. I'll do my best to check it today (or it will have to wait until the next).

0
Comment actions Permalink

Hello Karol Lewandowski

Sure, looking forward to hearing from you this week.

0
Comment actions Permalink

Hello Karol Lewandowski

Just wondering if you got a chance to take a look at the issue.

0
Comment actions Permalink

Hello Pani,
Yes, a template is visible only on the first wizard page and only when its projectTemplate element’s category attribute is true. The problem is that it won’t be visible in older IDEs. When it is not a category, then it is visible only in the old wizard on the second page.
Looking at the code, I’m not sure if it should still be used or if it is a bug. I’m waiting for the answer from the developer who developed this to confirm it is not deprecated.

0
Comment actions Permalink

Hello Karol Lewandowski

Any update for me ?

If this feature is deprecated, then what is the recommended alternate way? Please share if there are any examples of the same.

0
Comment actions Permalink

Hi Pani,

The initial answer I got was to use Generator API, but I'm still waiting for confirmation.

I'm really sorry that you have to wait so long, but the responsible developer is on vacation and will be back on Monday. I'll answer as soon as I get the information.

0
Comment actions Permalink

Hi Pani,

Again, I apologize for the long delay.

I’ve got information that ZIP templates will be deprecated and shouldn’t be used. Generator API should be used.

You should start with implementing com.intellij.ide.wizard.GeneratorNewProjectWizard. The example implementation is:
https://github.com/JetBrains/intellij-community/blob/master/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/archetype/MavenArchetypeNewProjectWizard.kt
The important method is createStep() which should return implementation of com.intellij.ide.projectWizard.generators.AssetsNewProjectWizardStep that allows generating project files from resources (it doesn’t support ZIP packages, files must be unpacked).

After implementing it, you should also implement GeneratorNewProjectWizardBuilderAdapter and register it as:

<moduleBuilder builderClass="YourModuleBuilder"/>

in plugin.xml

0
Comment actions Permalink

Hello Karol,
why can I not find the information about "Zip templates will be deprecated and shouldn't" be use anywhere?
I am realy disappointed about your support... The time when I opened this question no one tries to help me. So I needed to find a workaround. 
Will this happen for every request I make? I even gave you an example implementation in June. 

I will try it again with another issue next time and hope that the support team will help me as soon as possible. 

0
Comment actions Permalink

Hello Pascal,

I'm sorry, but I somehow missed your follow-up question. I will do my best so that it doesn't happen anymore.

I got the information about the deprecation plan yesterday. It was probably not done yet by mistake. I passed the information to the responsible developers to clarify it in the code.

Again, sorry for the inconvenience.

0

Please sign in to leave a comment.