从命令提示符执行mavenized selenium项目时出现TestNgeException

从命令提示符执行mavenized selenium项目时出现TestNgeException,maven,selenium-webdriver,webdriver,classpath,testng,Maven,Selenium Webdriver,Webdriver,Classpath,Testng,我正在使用“mvn clean install test”从命令提示符运行mavenized TestNG Webdriver项目,但在cmd提示符中出现以下异常 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2. 17:test (default-test) on project WebdriverWithTestNG: Execution default-test of goal o

我正在使用“mvn clean install test”从命令提示符运行mavenized TestNG Webdriver项目,但在cmd提示符中出现以下异常

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
17:test (default-test) on project WebdriverWithTestNG: Execution default-test of
goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: There was
an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR] An error occurred while instantiating class com.generic.validateorders.W
ebAppTest: null
[ERROR] at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:398)

另一方面,每当我从eclipse运行它时,它的执行都非常好,没有任何问题。我的项目类路径有问题吗?如果是,那么我如何修复它。

确保在pom.xml中为surefire插件配置将fork mode设置为never

<configuration>
<forkMode>never</forkMode>
</Configuration>

从未

确保在pom.xml中为surefire插件配置将fork mode设置为never

<configuration>
<forkMode>never</forkMode>
</Configuration>

从未

确保在pom.xml中为surefire插件配置将fork mode设置为never

<configuration>
<forkMode>never</forkMode>
</Configuration>

从未

确保在pom.xml中为surefire插件配置将fork mode设置为never

<configuration>
<forkMode>never</forkMode>
</Configuration>

从未

org.apache.maven.plugins
maven ejb插件
2.3
3
真的
org.apache.maven.plugins
maven surefire插件
2.15
真的

org.apache.maven.plugins
maven ejb插件
2.3
3
真的
org.apache.maven.plugins
maven surefire插件
2.15
真的

org.apache.maven.plugins
maven ejb插件
2.3
3
真的
org.apache.maven.plugins
maven surefire插件
2.15
真的

org.apache.maven.plugins
maven ejb插件
2.3
3
真的
org.apache.maven.plugins
maven surefire插件
2.15
真的

我也面临着类似的问题

根本原因: 我错误地删除了Maven创建的目标文件夹,并试图运行pom.xml

执行失败,错误如下:

[错误]未能执行目标org.apache.maven.plugins:maven surefire插件:2.19:project MoneyFlow上的测试(默认测试):执行目标org.apache.maven.plugins的默认测试:maven surefire插件:2.19:test失败:分叉过程中出错

解决方案

在eclipse中,右键单击
projectexplorer>Maven>updateproject
中的项目名称。它使用类文件更新目标文件夹。现在尝试重新运行
pom.xml


希望能有所帮助。

我也面临着类似的问题

根本原因: 我错误地删除了Maven创建的目标文件夹,并试图运行pom.xml

执行失败,错误如下:

[错误]未能执行目标org.apache.maven.plugins:maven surefire插件:2.19:project MoneyFlow上的测试(默认测试):执行目标org.apache.maven.plugins的默认测试:maven surefire插件:2.19:test失败:分叉过程中出错

解决方案

在eclipse中,右键单击
projectexplorer>Maven>updateproject
中的项目名称。它使用类文件更新目标文件夹。现在尝试重新运行
pom.xml


希望能有所帮助。

我也面临着类似的问题

根本原因: 我错误地删除了Maven创建的目标文件夹,并试图运行pom.xml

执行失败,错误如下:

[错误]未能执行目标org.apache.maven.plugins:maven surefire插件:2.19:project MoneyFlow上的测试(默认测试):执行目标org.apache.maven.plugins的默认测试:maven surefire插件:2.19:test失败:分叉过程中出错

解决方案

在eclipse中,右键单击
projectexplorer>Maven>updateproject
中的项目名称。它使用类文件更新目标文件夹。现在尝试重新运行
pom.xml


希望能有所帮助。

我也面临着类似的问题

根本原因: 我错误地删除了Maven创建的目标文件夹,并试图运行pom.xml

执行失败,错误如下:

[错误]未能执行目标org.apache.maven.plugins:maven surefire插件:2.19:project MoneyFlow上的测试(默认测试):执行目标org.apache.maven.plugins的默认测试:maven surefire插件:2.19:test失败:分叉过程中出错

解决方案

在eclipse中,右键单击
projectexplorer>Maven>updateproject
中的项目名称。它使用类文件更新目标文件夹。现在尝试重新运行
pom.xml


希望有帮助。

这是整个堆栈跟踪吗?@niharika:这是一个很长的堆栈跟踪,我如何共享它。基本上它总是在我跑步的时候出现