-1

This is my file directory。

enter image description here

And my pom.xml is that

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

    <!-- <properties> -->
        <!-- <maven.compiler.source>1.8</maven.compiler.source> -->
        <!-- <maven.compiler.target>1.8</maven.compiler.target> -->
       <!-- <argLine>-Dfile.encoding=UTF-8</argLine> -->
    <!-- </properties> -->
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <groupId>org.example</groupId>
    <artifactId>SE-Mapping</artifactId>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19</version>
                <configuration>
                    <skipTests>false</skipTests>
                    <includes>
                        <!--<include>*\*\*\*Test.java</include>-->
                        <include>**/**/*Test.java</include>
                        <include>**/*Test.java</include>
                        <include>*Test.java</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.jdt</groupId>
            <artifactId>org.eclipse.jdt.core</artifactId>
            <version>3.16.0</version>
        </dependency>
    </dependencies>

</project>
'''

but when I run the "mvn test",it tell me that enter image description here

It doesn't seem to run the test file I provided.And it donesn't generate the report.

How can I run the test file I provided ?

thanks.

Don
  • 21
  • 4
  • Remove all configuration from maven-surefire-plugin. Furthermore upgrade maven-surefire-plugin. The question which unit test frame work would you like to use because there is no dependency on junit or alike at all in your pom file? For example add a dependency see https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit.html or https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html – khmarbaise Sep 29 '21 at 07:08

1 Answers1

0

see answer Maven does not find JUnit tests to run

xwine
  • 91
  • 4