IntelliJ plugin deployment supports code generation indirectly :)
Each time your run Build > Prepare Plugin Module For Deployment, IntelliJ invokes "Make" command.
What you need to do is to mark Ant or Maven task as "Execute Before Make", then each time you run Make or Prepare Plugin For Deployment, the selected task will be executed.
How can I run the generate-sources phase? I don't see a way to include new phases under Lifecycle.
Your plugin should have generate-sources
goal.
Sample POM
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>eclipser</artifactId>
<version>1</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<configuration>
<models>
<model>src/main/mdo/maven.mdo</model>
</models>
<version>4.0.0</version>
</configuration>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>