Feuermurmel
Feuermurmel

Reputation: 9922

Using IntelliJ IDEA with Maven projects that use the "generate-sources" or "process-classes" lifecycle phases

I'm working on a Maven project that uses a plugins bound to the generate-sources and process-classes lifecycle phases. When the project is imported into IntelliJ IDEA, IDEA takes over compilation of the project sources and does so according to the settings in the pom.xml. But it does not implement any of the other lifecycle phases. How can I get these other lifecycle phases to be executed when building the project from within IntelliJ IDEA?

I know that I can create a run configuration that specifically runs Maven with the process-classes phase and then set this run configuration up to run before other configurations, but that will build all modules and not just the modules necessary for that particular run configuration, besides it taking an order of magnitude longer than a build from with IntelliJ IDEA. Is there a better way?

Upvotes: 14

Views: 4034

Answers (1)

KMR
KMR

Reputation: 808

Unfortunately, the only two options for the maven Lifecycle in IntelliJ are Basic and Full (Cog -> untick Show Basic Phases Only).

If you are happy with it running the full suite of phases you can just run the full set, but otherwise the best option is just to add all the appropriate ones to a run configuration and run that on its own.

Upvotes: 1

Related Questions