解决Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test)

Today, I created a new project and made some things. After I packaged it and reported an error, I was surprised because this project only had a few categories, and there were so few things. It shouldn’t be an error.
insert image description here
After investigation, it is found that it is a problem with the test case. There are two solutions:
the first one:

 <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
            <configuration>
                <skipTests>true</skipTests>
            </configuration>
        </plugin>
    </plugins>

The second is the easiest, directly find the test cases in the test folder, delete them directly, and the package will be fine
insert image description here

Guess you like

Origin blog.csdn.net/qq_39486119/article/details/116152976