<
plugin
>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefireArgLine}</argLine>
<!--testng.xml -->
<suiteXmlFiles>
<suiteXmlFile>target/test-classes/testcase/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
<!-- <debugForkedProcess>true</debugForkedProcess> -->
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
</properties>
<!-- target -->
<workingDirectory>target/</workingDirectory>
</configuration>
</plugin>
按上述配置執行,maven test 會忽略程序中的斷點執行,如果要進行調試可通過下面兩個方法設置:
1、使用配置
testFailureIgnore
配置
在pom.xml文件中
<
configuration
>
結點下,增加
<debugForkedProcess>true</debugForkedProcess>
2、配置maven test參數
在Debug->Debug Config 設置框中,設置Goals值為:test -Dmaven.surefire.debug即可。

注意:在配置支持斷點調試的模式下運行后,控制台console會出現“
Listening for transport dt_socket at address: 5005
”,要單擊一下才能繼續運行。