creating a maven pom file in intellij plugin new project wizard

332 Views Asked by At

I am writing an Intellij-idea plugin. In the plugin I want to define a new project type using new project wizard. My project should contain a specific pom file to build the project.

Any idea how I can do that? Shall I try to create the pom-file pro grammatically or shall I save a pom file as a template?

2

There are 2 best solutions below

0
On BEST ANSWER

I resolved this by adding <depends>org.jetbrains.idea.maven</depends> to my plugin. Then I added a new ModuleBuilder based on jetbrains example.

I extended MavenModuel Builder (Some methods are neccessary to override e.g. getBuilderId(), getPresentableName()).

By this you are getting a pom file very easy. By cutomizing the ModuleType and ModuleBuilder you can add things that you want to POM file.

0
On

I generally create my IntelliJ projects using mvn archetype:generate then import it into IntelliJ.