Run single method test doesn't invoke the lifecyle from custom Plugin

Answered

Hi,

I created a plugin maven for my tests, this maven plugin invoked when the lifecycle is "PRE_INTEGRATION_TEST" and "POST_INTEGRATION_TEST", so before and after the goal verify.

When I execute "verify" by the Maven Projects Window on Intellij, all it works like I want. So, the lifecyle "PRE_INTEGRATION_TEST" from my maven plugin executed before the goal verify and "POST_INTEGRATION_TEST" after.

But, when I execute a single method test by rightclick, so the lifecycle didn't invoked.

Do you know why intellij didn't execute lifecyle maven when I want to execute a quick test ?

Sorry for my english, it's not my native language.

0
5 comments

There is no support for that at the moment, see the related issues:

https://youtrack.jetbrains.com/issue/IDEA-64665
https://youtrack.jetbrains.com/issue/IDEA-53790
https://youtrack.jetbrains.com/issue/IDEA-93831

Every custom plug-in lifecycle would require special support from the IDE side.

0
Avatar
Permanently deleted user

Oh... ok but I don't understand why it works by "maven project window" and not "quick test by right click" ?

Intellij doesn't build for a quick test with pom.xml ?

0

Quick test is executed without any Maven knowledge, it's built-in Run/Configuration.

0
Avatar
Permanently deleted user

And we can't specify that in Intellij configuration ?

0

You can edit Default Run/Debug configuration for all Unit tests and add Before Launch step to run some Maven goal. But it will be executed for all your tests in the project, not just integration or single method.

0

Please sign in to leave a comment.