title: Using IntelliJ IDEA with Maven projects that use the "generate-sources" or "process-classes" lifecycle phases
body: <p>I'm working on a <em>Maven</em> project that uses a plugins bound to the <code>generate-sources</code> and <code>process-classes</code> lifecycle phases. When the project is imported into <em>IntelliJ IDEA</em>, IDEA takes over compilation of the project sources and does so according to the settings in the <code>pom.xml</code>. 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?</p>
  
  <p>I know that I can create a run configuration that specifically runs Maven with the <code>process-classes</code> 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?</p>