Чтобы выполнить один тест из Maven pom.xml, мы можем выполнить его из плагина maven surefire.
http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<includes>
<include>App.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
Но сейчас это не работает.Чего не хватает, чтобы объявить?Я помню, до того, как я выполнил несколько месяцев, и это сработало.
Консоль:
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< mavenSampleProject01:mavenSampleProjects >--------------
[INFO] Building mavenSampleProjects 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mavenSampleProjects ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Desktop-pc\eclipse-workspace\mavenSampleProjects\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ mavenSampleProjects ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mavenSampleProjects ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Desktop-pc\eclipse-workspace\mavenSampleProjects\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ mavenSampleProjects ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) @ mavenSampleProjects ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.371 s
[INFO] Finished at: 2018-10-02T11:58:27+05:30
[INFO] ------------------------------------------------------------------------