Java 没有找到处理 jacoco-maven-plugin 的市场条目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18426360/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 01:33:16  来源:igfitidea点击:

No marketplace entries found to handle jacoco-maven-plugin

javaeclipsemavenjacoco

提问by liv2hak

When I try to import a maven project into eclispe juno I am getting the following error.jacoco maven error in eclipse.

当我尝试将 Maven 项目导入 eclispe juno 时,出现以下错误。eclipse 中的 jacoco maven 错误。

I have the following lines in my pom.xml.

我的 pom.xml 中有以下几行。

 </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.6.3.201306030806</version>
        <configuration>
          <destfile>${basedir}/target/jacoco/jacoco.exec</destfile>
          <datafile>${basedir}/target/jacoco/jacoco.exec</datafile>
        </configuration>
        <executions>
          <execution>
            <id>jacoco-initialize</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-site</id>
            <phase>package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

Why is maven giving this error? Any idea.

为什么 maven 会出现这个错误?任何的想法。

采纳答案by René Link

The m2e plugin reports the error, because it can not find a m2e plugin that can handle the jacoco-maven-pluign configuration and execution within eclipse.

m2e插件报错,因为在eclipse中找不到可以处理jacoco-maven-pluign配置和执行的m2e插件。

Thus the build on the command line via maven might lead to other results than the eclipse build.

因此,通过 maven 在命令行上构建可能会导致除 eclipse 构建之外的其他结果。

You are using the jacoco-maven-plugin and I don't think it is necessarry to install a m2e plugin for jacoco.

您正在使用 jacoco-maven-plugin,我认为没有必要为 jacoco 安装 m2e 插件。

You can either try to find a jacoco m2e adapter update site and install it or you move the jacoco-maven-plugin into a profile and only activate it when you need it.

您可以尝试查找 jacoco m2e 适配器更新站点并安装它,或者将 jacoco-maven-plugin 移动到配置文件中,并仅在需要时激活它。

EDIT

编辑

You can also tell the eclipse m2e plugin to ignore the jacoco-maven-plugin configuration. Add the follwing plugin configuration to the pluginManagement

您还可以告诉 eclipse m2e 插件忽略 jacoco-maven-plugin 配置。将以下插件配置添加到pluginManagement

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                 <groupId>org.jacoco</groupId>
                                <artifactId>jacoco-maven-plugin</artifactId>
                                <versionRange>[0.0.0,)</versionRange>
                                <goals>
                                    <goal>prepare-agent</goal>
                                    <goal>report</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore />
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

This should work too.

这也应该有效。

You will find more information in the m2e documentation

您将在m2e 文档中找到更多信息

回答by Damian

Install EclEmma plugin from the marketplace and reload projects

从市场安装 EclEmma 插件并重新加载项目

回答by user12722818

  1. Right click on the Maven project.

  2. Hover over the Maven option.

  3. Choose update project.

  1. 右键单击 Maven 项目。

  2. 将鼠标悬停在 Maven 选项上。

  3. 选择更新项目。

Worked for me, Hope it helps you too.

为我工作,希望它也能帮助你。