如何在自定义生命周期期间使用程序集插件附加工件

发布于 2024-09-26 05:33:32 字数 1101 浏览 2 评论 0原文

我正在尝试创建一个具有自定义生命周期的插件:

/**
 * @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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生死何惧 2024-10-03 05:33:32

使用了哪个版本的 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 to true meaning the created artifact should end up in the repository.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文