How to attach an artifact with assembly-plugin during custom lifecycle
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>
<li开发者_开发百科fecycle>
<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
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 to true
meaning the created artifact should end up in the repository.
精彩评论