简体   繁体   中英

Run pre-integration-phase when running all tests in IntelliJ

When I run all tests in IntelliJ for a maven project (right click on the project, Run , All tests ) some integration tests fail because the pre-integration-test phase is not executed.

In my pom I have a maven plugin which is configured to run during the pre-integration-test phase. When I do mvn verify it gets executed before all the integration tests. But when I run it in IntelliJ it doesn't.

Any idea how to tell IntelliJ to run this phase?

When you right-click > Run All tests, then not Maven is used but a normal JUnit (or whatever you use for your Tests) Runner is executed.

If you've already configured it in Maven, try running it from the maven view on the right side of Idea open "Maven Projects" > select verify (or any other phase) > push the green Play button at the top. (Multi-select is possible by pressing and holding the Ctrl-Button)

Alternatively you may execute a specific maven goal by editing the Run-Configuration (or even the default for Unit-Tests) and adding an entry in the Before launch section.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM