【问题标题】:OpenClover not Running - ErrorOpenClover 未运行 - 错误
【发布时间】:2017-11-13 11:38:36
【问题描述】:

我正在尝试将 OpenClover 集成到我的项目中。 我有一个基于 Java 的 webapp,我使用 maven 我已将插件设置如下

        <plugin>
            <groupId>org.openclover</groupId>
            <artifactId>clover-maven-plugin</artifactId>
            <version>4.2.0</version>
            <configuration>
                <targetPercentage>50%</targetPercentage>
            </configuration>
            <executions>
                <execution>
                    <phase>verify</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

当我运行以下命令时

mvn clean test clover:aggregate clover:clover -Dsurefire.skip.tests=false;

我收到此错误

[ERROR] Failed to execute goal org.openclover:clover-maven-plugin:4.2.0:setup (default-cli) on project fcservices-web: Execution default-cli of goal org.openclover:clover-maven-plugin:4.2.0:setup failed: Unable to load the mojo 'setup' (or one of its required components) from the plugin 'org.openclover:clover-maven-plugin:4.2.0': com.google.inject.ProvisionException: Guice provision errors:
[ERROR]
[ERROR] 1) No implementation for org.apache.maven.execution.MavenSession was bound.
[ERROR] while locating com.atlassian.maven.plugin.clover.CloverSetupMojo
[ERROR] at ClassRealm[plugin>org.openclover:clover-maven-plugin:4.2.0, parent: sun.misc.Launcher$AppClassLoader@55f96302]
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with @com.google.inject.name.Named(value=org.openclover:clover-maven-plugin:4.2.0:setup)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.openclover:clover-maven-plugin:4.2.0:setup
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

有什么想法吗?

谢谢 达米安

【问题讨论】:

  • 您是否在为这个三叶草使用受支持的 maven 版本?您尝试过旧版本吗?
  • 您能写出您使用哪个 Maven 版本吗?此外,Maven 报告它尝试执行 clover:setup 目标,但您没有在任何地方配置它,也没有明确执行。你有一些你的项目可能继承的父配置 OpenClover 设置在哪里?你能用这些更新你的问题吗?
  • @Hrabosch - 我使用的是 Maven 版本 3.0.5
  • @grzlew- 我没有在父 pom 中配置任何东西。这以前在另一个项目上工作过,没有提到 pom 中的设置目标
  • @Damien 好的,所以这是错误的版本。您可以使用较新的 maven 或较旧的三叶草版本 :) 由您决定。

标签: java maven clover


【解决方案1】:

从错误看来,您需要更高版本的 Maven 或旧版本的 Clover 插件。

【讨论】:

    【解决方案2】:

    转到最新版本的 Maven (3.5.2) 解决了这个问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-16
      • 2013-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-02
      相关资源
      最近更新 更多