Unable to load the mojo 'test' in the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0'

Вот мой pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.alex</groupId>
    <artifactId>rest-assured-client</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>rest-assured-client</name>
    <description>Project for testing app catalog</description>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <java.version>17</java.version>
        <surefire-plugin.version>3.0.0</surefire-plugin.version>
        <lombok.version>1.18.22</lombok.version>
        <rest-assured.version>5.3.0</rest-assured.version>      
        <junit.jupiter.version>5.8.2</junit.jupiter.version>
        <hamcrest-all.version>1.3</hamcrest-all.version>
        <testng.version>7.7.1</testng.version>
        <log4j.version>2.17.1</log4j.version>
    </properties>
    <dependencies>

        <!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured -->
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest-assured.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
            <version>${lombok.version}</version>
        </dependency>

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

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest-all.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.testng/testng -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.codehaus.plexus/plexus-utils -->
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>3.5.1</version>
        </dependency>


    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
            </plugin>
        </plugins>
    </build>

</project>

При запуске

mvn test


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0:test (default-test) on project rest-assured-
client: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0:test failed: Unable to load the mojo
 'test' in the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0'. A required class is missing: org/apache/maven/plug
in/surefire/SurefireReportParameters
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-surefire-plugin:3.0.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/alex/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/3.0.0/maven-surefire-pl
ugin-3.0.0.jar
[ERROR] urls[1] = file:/C:/Users/alex/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : org.apache.maven.plugin.surefire.SurefireReportParameters

Я уже явно добавил зависимость plexus-utils более свежей версии

И все равно получаю ту же ошибку

В чем тут проблема? Может какие-то зависимости не подтянулись? Дело в том, что я maven-surefire-plugin v3.0.0 ставил вручную из jar-файла, у меня щас нет доступа к интернету.

Действительно очень похоже, что проблема именно в том, что ручная установка maven-surefire-plugin не подтягивает все зависимости. Т.к. я попробовал скомпилировать другой проект, который 100% работает на машине, где есть интернет и все зависимости подтягиваются автоматически. А тут он выдает ту же ошибку. Но как мне найти всё зависимости, которые нужны этому плагину, чтобы установить их?


Ответы (0 шт):