Java 在IntelliJ插件构建期间运行代码生成器

Java 在IntelliJ插件构建期间运行代码生成器,java,build,intellij-idea,code-generation,intellij-plugin,Java,Build,Intellij Idea,Code Generation,Intellij Plugin,我正在做一个作为IntelliJ插件发布的项目。项目所需的一些源代码是在编译Java源文件之前通过代码生成步骤创建的。这些生成的文件未置于源代码管理中 我为这个代码生成器提供了Ant任务和Maven插件,可以将代码生成步骤可靠地集成到这两个构建系统中 IntelliJ如何在IntelliJ插件项目的构建过程中支持代码生成?IntelliJ插件部署间接支持代码生成:) 每次运行Build>preparepluginmodulefordeployment时,IntelliJ都会调用“Make”命令

我正在做一个作为IntelliJ插件发布的项目。项目所需的一些源代码是在编译Java源文件之前通过代码生成步骤创建的。这些生成的文件未置于源代码管理中

我为这个代码生成器提供了Ant任务和Maven插件,可以将代码生成步骤可靠地集成到这两个构建系统中


IntelliJ如何在IntelliJ插件项目的构建过程中支持代码生成?

IntelliJ插件部署间接支持代码生成:)

每次运行Build>preparepluginmodulefordeployment时,IntelliJ都会调用“Make”命令

您需要做的是将Ant或Maven任务标记为“在Make之前执行”,然后每次运行Make或Prepare Plugin进行部署时,都会执行所选任务

如何运行生成源阶段?我看不到在生命周期中包含新阶段的方法

你的插件应该有
生成源代码
目标

样品聚甲醛

<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>

4.0.0
com.mycompany.app
日食者
1.
org.codehaus.modello
modellomaven插件
1.4
src/main/mdo/maven.mdo
4.0.0
JAVA

如何运行
生成源
阶段?我看不到在生命周期中包含新阶段的方法。你的插件应该有
生成源代码
目标。