在我的Java项目中,我通过idlj-maven-plugin从IDL文件生成了大量源文件。它运行良好 - 它在编译之前生成文件,例如,我在Eclipse中运行编译目标。但是,我想知道当有人在Eclipse中导入我的项目时是否可以生成源文件。我的意思是,我想在下面的场景中实现最后一步:
在M2Eclipse描述中,有一条声明表明可以在导入项目时设置目标。我一直在寻找有关如何配置M2Eclipse的信息,但没有运气。
答案 0 :(得分:3)
我自己还没有使用idlj-maven-plugin
,但我们调整了常规" ignore-eclipse-mapping" -plugin配置,为我们内部需求开发的另一个自定义插件:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>OUR_PLUGIN_GROUP_ID</groupId>
<artifactId>OUR_PLUGIN_ARTIFACT_ID</artifactId>
<versionRange>[2.3,)</versionRange> <!-- Or whatever -->
<goals>
<goal>generate</goal> <!-- Or whatever idlj needs -->
</goals>
</pluginExecutionFilter>
<action>
<!-- this is what decides if the plugin should run or not -->
<!-- Most often, you will have an <ignore/> tag instead. -->
<execute>
<runOnIncremental>false</runOnIncremental>
</execute >
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
我认为this链接有一些相关信息。