Intellij: How to create context-sensitive Maven shortcuts
<p>I have many maven modules in my IntelliJ project - I want to be able to use a shortcut to quickly <code>mvn clean install</code> whenever I want on whichever module I'm currently busy with. For example: if I have X.java open in my editor and I press alt-M with my cursor anywhere in the editor, then Intellij must run 'mvn clean install' on the module in which X.java occurs. </p>

<p>I know about maven keyboard shortcuts, but I don't know how to make them context sensitive. Also, defining a maven run configuration also seem to require of me to specify exactly which module to build. I simply have too many Maven modules to assign a unique keyboard shortcut to every one of them or select them from a list every time.</p>

<p>I know IntelliJ supports context sensitive actions, because the "Make" and "Compile" actions all seem to magically know which module you mean. Is the same sophistication available for maven shortcuts?</p>

<p>I recently switched from Eclipse (which supports this via context-sensitive run configurations), but this is a real bugbear. Am I missing a trick?</p>