关于selenium:通过Maven运行测试脚本时执行中的问题

Issues in exceution while run the test script through Maven

当我通过maven测试执行我的测试脚本时,它显示错误。 以下是运行时的错误。

[INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building Talentrack V1 [INFO]
------------------------------------------------------------------------ [INFO] Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom
[INFO] Downloaded:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom
(11 KB at 4.5 KB/sec) [INFO] Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom
[INFO] Downloaded:
https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom
(14 KB at 21.1 KB/sec) [INFO] [INFO] ---
maven-resources-plugin:2.6:resources (default-resources) @ Talentrack
--- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non
existing resourceDirectory
D:\Talentrack_talent\Talentrack\src\main
esources [INFO] [INFO] ---
maven-compiler-plugin:3.3:compile (default-compile) @ Talentrack ---
[INFO] Changes detected - recompiling the module! [WARNING] File
encoding has not been set, using platform encoding Cp1252, i.e. build
is platform dependent! [INFO] Compiling 10 source files to
D:\Talentrack_talent\Talentrack\target\classes [INFO]
------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO]
------------------------------------------------------------- [ERROR] No compiler is provided in this environment. Perhaps you are running
on a JRE rather than a JDK? [INFO] 1 error [INFO]
------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 4.087 s [INFO] Finished at:
2016-05-17T16:35:05+05:30 [INFO] Final Memory: 9M/121M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.3:compile
(default-compile) on project Talentrack: Compilation failure [ERROR]
No compiler is provided in this environment. Perhaps you are running
on a JRE rather than a JDK? [ERROR] -> [Help 1] [ERROR] [ERROR] To
see the full stack trace of the errors, re-run Maven with the -e
switch. [ERROR] Re-run Maven using the -X switch to enable full debug
logging. [ERROR] [ERROR] For more information about the errors and
possible solutions, please read the following articles: [ERROR] [Help
1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


Compilation failure [ERROR] No compiler is provided in this
environment. Perhaps you are running on a JRE rather than a JDK?

您需要在系统变量/ bash配置文件中指定JDK路径,这可以通过向其添加JAVA_HOME变量来完成。