IntelliJ, run java test from terminal, Maven
Hi, Iam quite new in testing from IntelliJ. I can run Junit test usual way, it shows test passed/failed but when I run test from IntelliJ terminal via command "mvn test" - using Maven, it shows this log:
/no test ran, nothing passed or failed
-not using any Jupiter, only Junit plugin.
Can you help me to fix this problem somehow.
Thank you a lot. Joseph
Log:
PS C:\Users\josef\javafortesters> mvn test
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.example:javafortesters:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.version' for org.junit.jupiter:junit-jupiter:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 19, colum
n 22
[WARNING] 'dependencies.dependency.version' for org.junit.jupiter:junit-jupiter:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 25, colum
n 22
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.junit.jupiter:junit-jupiter:jar -> duplicate declaration of version REL
EASE @ line 22, column 21
[WARNING] 'dependencies.dependency.version' for org.testng:testng:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 31, column 22
[WARNING] 'dependencies.dependency.version' for junit:junit:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 37, column 22
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> version 3.8.1 vs RELEASE @ line 34, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ---------------------< org.example:javafortesters >---------------------
[INFO] Building javafortesters 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ javafortesters ---
[WARNING] Using platform encoding (Cp1250 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ javafortesters ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ javafortesters ---
[WARNING] Using platform encoding (Cp1250 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\josef\javafortesters\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ javafortesters ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ javafortesters ---
[INFO] Surefire report directory: C:\Users\josef\javafortesters\target\surefire-reports
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.524 s
[INFO] Finished at: 2021-12-24T14:54:04+01:00
[INFO] ------------------------------------------------------------------------
PS C:\Users\josef\javafortesters>
请先登录再写评论。
Do you have tests in this project Maven project and test dependencies set up? Please check https://stackoverflow.com/a/6178629/2000323