如何在自定义生命周期期间使用程序集插件附加工件
我正在尝试创建一个具有自定义生命周期的插件:
/**
* @goal my-goal
* @execute lifecycle="my-custom-lifecycle" phase="attach-foo"
*/
public class MyMojo extends AbstractMojo {
...
使用 src/main/resources/META-INF/maven/lifecycle.xml 文件:
<lifecycles>
<lifecycle>
<id>attach-foo</id>
<phases>
<phase>
<id>package</id>
<executions>
<execution>
<goals>
<goal>
org.apache.maven.plugins:maven-assembly-plugin:single
</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptor>adescriptor.xml</descriptor>
</descriptorRefs>
</configuration>
</execution>
</executions>
</phase>
</phases>
</lifecycle>
</lifecycles>
不幸的是,调用了 Assembly-plugin,生成的 zip 工件未附加并安装在存储库中。 有什么想法吗
?
谢谢
i'm trying to create a plugin with a custom lifecycle :
/**
* @goal my-goal
* @execute lifecycle="my-custom-lifecycle" phase="attach-foo"
*/
public class MyMojo extends AbstractMojo {
...
with src/main/resources/META-INF/maven/lifecycle.xml file :
<lifecycles>
<lifecycle>
<id>attach-foo</id>
<phases>
<phase>
<id>package</id>
<executions>
<execution>
<goals>
<goal>
org.apache.maven.plugins:maven-assembly-plugin:single
</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptor>adescriptor.xml</descriptor>
</descriptorRefs>
</configuration>
</execution>
</executions>
</phase>
</phases>
</lifecycle>
</lifecycles>
Assembly-plugin is called unfortunately the zip artifact generated is not attached and install in repo...
Any ideas ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用了哪个版本的 maven-assemble-plugin?根据 插件文档,有一个可选参数 < code>attach 在 2.2-beta-1 及更高版本中可用。该值默认为
true
,这意味着创建的工件应该最终出现在存储库中。Which version of the maven-assembly-plugin was used? Per the plugin docs, there is an optional parameter
attach
available in versions 2.2-beta-1 and later. The value defaults totrue
meaning the created artifact should end up in the repository.