默认跳过maven2插件
我正在寻找一种不在安装时执行插件的方法。更具体地说,我的场景如下:
- 我使用 org.apache.cxf:cxf-codegen-plugin 生成源代码。
- 每次我清理+安装都会生成源代码,
- 我只希望在我明确请求时生成源代码。
任何和所有的帮助将不胜感激!
I am looking for a way to not have a plugin execute on install. More specifically, my scenario is as follows:
- I am using org.apache.cxf:cxf-codegen-plugin to generate source code.
- Every time I clean+install the source is generated
- I only want generation of source code to happen when I explicitly request it.
Any and all help would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最好的选择是在配置文件中添加插件声明并显式激活此配置文件:
并在您希望生成代码时运行以下命令:
The best option would be to add the plugin declaration in a profile and to explicitly activate this profile:
And run the following when you want the code generation to happen:
我相信您想在 POM 中的 cxf 的 plugin 元素中添加一个 executions 元素。您应该能够将生成目标绑定到您想要的阶段。请参阅: http://maven.apache.org/pom.html#Plugins
I believe you want to add an executions element to cxf's plugin element in your POM. You should be able to bind the generation goal to the phase you'd prefer. See: http://maven.apache.org/pom.html#Plugins