在maven插件执行中禁用目标

我有一个设置,其中我的大多数项目都需要为编译和testCompile目标运行xtend插件。 我在pluginManagement部分描述它:

 org.eclipse.xtend xtend-maven-plugin 2.5.3    compile testCompile     

现在,有些项目不需要一个目标或另一个目标。 我尝试了inheritance的标签,随机属性玩,但没有工作。 如何覆盖执行以仅包含所需目标?

更新 :故事的结论是不能禁用个人目标。 可以管理的最小范围是execution

通常,您只能使用技巧禁用执行:

将执行阶段设置为不存在阶段( dont-execute )。 但请注意,您必须使用两个不同的执行ID才能允许单独关闭两个目标:

  org.eclipse.xtend xtend-maven-plugin 2.5.3   xtend-compile  compile testCompile    xtend-testCompile  testCompile     

子模块:

  org.eclipse.xtend xtend-maven-plugin 2.5.3   xtend-testCompile dont-execute    

在您的特定情况下,您当然也可以在每次执行中使用skipXtend配置属性来跳过执行,但只是阻止插件执行任何操作:

  org.eclipse.xtend xtend-maven-plugin 2.5.3   xtend-testCompile  xtend-testCompile