[Commented] (SUREFIRE-1637) java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass Migrating to 5.4.0

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Commented] (SUREFIRE-1637) java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass Migrating to 5.4.0

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/SUREFIRE-1637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16766216#comment-16766216 ]

Ahmed Yarub Hani Al Nuaimi commented on SUREFIRE-1637:
------------------------------------------------------

Fixed by replacing:

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <version>1.4.0</version>
            <scope>test</scope>
        </dependency>

with:
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>

> java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass Migrating to 5.4.0
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1637
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1637
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 5.x support
>    Affects Versions: 3.0.0-M3
>         Environment: Windows 10
>            Reporter: Ahmed Yarub Hani Al Nuaimi
>            Priority: Major
>
> JDK: 11
> Spring Boot: 2.1.2.RELEASE
> JUnit: 5.4.0
> Maven: 3.6.0
> Surefire: 3.0.0-M3
> At first, I got the following error running the tests on IntelliJ and using the command mvn clean install:
> ```
> [INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) @ xxxxx ---
> [INFO]
> [INFO] -------------------------------------------------------
> [INFO] T E S T S
> [INFO] -------------------------------------------------------
> Feb 12, 2019 12:53:00 PM org.junit.platform.launcher.core.DefaultLauncher handleThrowable
> WARNING: TestEngine with ID 'junit-jupiter' failed to execute tests
> java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass(Ljava/lang/String;)Lorg/junit/platform/commons/function/Try;
>  at org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollector.createAbortedExecutionPredicate(OpenTest4JAndJUnit4AwareThrowableCollecto
> ```
> After adding this dependency, I could run the tests in IntelliJ but not using Maven:
> ```
>  <dependency>
>  <groupId>org.junit.platform</groupId>
>  <artifactId>junit-platform-launcher</artifactId>
>  <version>1.4.0</version>
>  <scope>test</scope>
>  </dependency>
> ```
> Rolling back to version 5.3.2 solves the problem



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)