In IntelliJ, how do i debug a maven test goal?

前端 未结 6 956
旧时难觅i
旧时难觅i 2020-12-22 17:13

Using intellij and maven pom files, how do i debug tests run inside the maven test goal?

When i run them directly in the code, it complains something about profiles

6条回答
  •  醉酒成梦
    2020-12-22 17:25

    http://maven.apache.org/plugins/maven-surefire-plugin/examples/debugging.html

    In IDEA, run your test in debug mode "mvn -DforkMode=never test"

    Updated: Open your run/debug configuration, in "Runner" tab, add -DforkMode=never

    (Noted by @mikeapr4: newer versions of the surefire plugin (2.14+) use mvn -DforkCount=0 test)

提交回复
热议问题