maven:生命周期配置未涵盖的插件执行

maven: Plugin execution not covered by lifecycle configuration

我使用 eclipse 并在我的 pom.xml 中包含以下依赖项:

<dependency>
    <groupId>org.jboss.jandex</groupId>
    <artifactId>jandex-maven-plugin</artifactId>
    <version>1.0.7</version>
</dependency>

使用此插件时:

<build>
       <plugins>
              <plugin>
                <groupId>org.jboss.jandex</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version>1.0.7</version>
                <executions>
                    <execution>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
      </plugins>
...
</build>

我在 eclipse 中遇到这个错误 ide:

 Plugin execution not covered by lifecycle configuration: 
org.jboss.jandex:jandex-maven-plugin:1.0.7:jandex 
(execution: make-index, phase: process-classes)

点击 "Discover new m2 connectors" 时,出现错误:

No marketplace entries found to handle jandex-maven-plugin:1.0.7:jandex in Eclipse. 
Please see Help for more information.

我该如何解决这个问题?

解决方案:

在 pom.xml 中添加了 <?m2e ignore?>

<!-- https://www.eclipse.org/m2e/documentation/release-notes-17.html#new-syntax-for-specifying-lifecycle-mapping-metadata -->
            <plugin>
                <groupId>org.jboss.jandex</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version><dependency>
                <groupId>org.jboss.jandex</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version>1.0.7</version>
                <executions>
                    <execution>
                        <!-- added: -->
                        <?m2e ignore?>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Jandex 插件没有用于 Eclipse 的连接器。

只需添加一个忽略规则。如果您选择了正确的选项,Eclipse 会为您执行此操作,并将忽略规则添加到您的 pom.xml.

事实证明1 您应该 忽略 Eclipse 中的 Jandex 插件。否则,您的 @QuarkusTest 可能会因 ArC/CDI 错误而失败。

我创建了一个 PR,将所需的 m2e 配置添加到插件2。一旦合并并发布,就不会有生命周期问题了。


1https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Jandex-Plugin.20in.20Eclipse.20m2e

2 https://github.com/wildfly/jandex-maven-plugin/pull/18

似乎有一个更新的 Jandex 版本 1.0.8 可能已经解决了这个问题。我在链接到 1.0.7 的多模块 Maven 上引用了 quarkus 文档。我在 quarkus:dev 模式下遇到了一些问题 运行。一旦我意识到有 1.0.8 更新,我所有的问题都消失了。