title: Cannot run maven tasks in Intellij - maven home not valid
body: <p>I'm running IntelliJ on windows, and am trying to run a task on a maven plugin. Whenever I do so ('Run Maven Build' from the right-click menu), I get an error saying</p>
  
  <blockquote>
    <p>No valid Maven installation found. Either set the home directory, or set the M2_HOME env variable.</p>
  </blockquote>
  
  <p>I already have maven dependencies downloaded into <code>%userprofile%\.m2</code>. If I set the home directory to <code>%userprofile%\.m2</code>, I get another error:</p>
  
  <blockquote>
    <p>&lt;dir&gt; is not a valid Maven home directory.</p>
  </blockquote>
  
  <p>What is a valid Maven home directory, and how do I get one on windows?</p>