【问题标题】:mvn clean test is failing for Mule Munit test casesMule Munit 测试用例的 mvn clean test 失败
【发布时间】:2015-10-30 10:17:33
【问题描述】:

我在 Mule Mnuit 测试用例上运行 mvn clean test 命令。我最终遇到了 API 不兼容错误:

[ERROR] Failed to execute goal com.mulesoft.munit.tools:munit-maven-plugin:1.0.0:test (test) on project sunguard-session: 
Execution test of goal com.mulesoft.munit.tools:munit-maven-plugin:1.0.0:test failed: 
An API incompatibility was encountered while executing com.mulesoft.munit.tools:munit-maven-plugin:1.0.0:test: java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getContainingClass()Ljava/lang/Class;

有谁能解决这个问题?

【问题讨论】:

  • 您能否提供更多信息?我最终无法重现此错误,您使用的是什么 Maven/Mule/MUnit 版本。操作系统和 Java 版本也可以提供帮助。

标签: maven mule munit


【解决方案1】:

在我们的项目中,我们仍然面临同样的问题。我们发现为了通过 maven 编译测试,我们必须使用不同版本的 MUNIT

<munit.version.rc1>3.6.0-RC1</munit.version.rc1>

插件

<plugin>
            <groupId>org.mule.munit.tools</groupId>
            <artifactId>munit-maven-plugin</artifactId>
            <version>${munit.version.rc1}</version>
            <executions>
                <execution>
                    <id>test</id>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

以及相关的Runner

<dependency>
        <groupId>org.mule.munit</groupId>
        <artifactId>munit-runner</artifactId>
        <version>${munit.version.rc1}</version>
        <scope>test</scope>
    </dependency>

【讨论】:

    【解决方案2】:

    从家中删除 .m2 文件夹,然后从 mule 项目下载 maven 依赖项。

    【讨论】:

      猜你喜欢
      • 2016-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-21
      • 2021-05-17
      • 2021-04-23
      • 2016-01-25
      相关资源
      最近更新 更多