'mvn clean test is failing for Mule Munit test cases

I am running mvn clean test command on Mule Mnuit test cases. I end up with an API incompatibility error:

[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;

Can any solve this issue?



Solution 1:[1]

We are still facing the same issue in out project. We found out that in order to compile the test via maven, we had to use a different version of MUNIT

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

The plugin

<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>

And the relevant Runner

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

Solution 2:[2]

Delete the .m2 folder from home and then download maven dependencies from mule project.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mulesoftbeginner
Solution 2 Mayur Shirurkar