Reputation: 16554
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?
Upvotes: 4
Views: 706
Reputation: 1994
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.
Upvotes: 3