title: Run maven cucumber tests from IntelliJ
body: <p>I have a maven project, which run cucumber tests using JUnit runner.  I can use the following syntax from command line to run the tests:</p>
  
  <pre><code>mvn -Dcucumber.options="--tags @Sanity" test
  </code></pre>
  
  <p>This works perfectly fine when run from the console.  Now I'm trying to set up Maven runner configuration in IntelliJ IDEA to do the same - and I just can't get it to work.  According to the <a href="https://www.jetbrains.com/help/idea/maven-runner.html" rel="nofollow noreferrer">IntelliJ documentation</a>, I need to \-escape double quotes - so in the command line I specify <code>-Dcucumber.options=\'--tags @Sanity\' test</code></p>
  
  <p>Maven is executed - but produces this error message:</p>
  
  <pre><code>Unknown lifecycle phase "@Sanity""
  </code></pre>
  
  <p>It appears that the parameter is unescaped before being passed to maven. I then tried to putting the entire thing in quotes, specifying parameters as <code>'-Dcucumber.options=\"--tags @Sanity\"' test</code>. This results in the following error:</p>
  
  <pre><code>Unknown lifecycle phase "'-Dcucumber.options="--tags"
  </code></pre>
  
  <p>Again, I guess, something is with quoting/escaping.  I then tried these options: <code>"-Dcucumber.options='--tags @Sanity'" test</code> - this time maven goes through the compilation stage and seemingly attempts to run tests - but then fails with the following error:</p>
  
  <pre><code>Tests in error: 
  </code></pre>
  
  <p>initializationError(com.mycompany.mypackage.MyRunner): Unknown option: --tags @Sanity</p>
  
  <p>I tried all sorts of quoting/escaping/double-escaping/double-quoting/etc. - to no avail.</p>
  
  <p>Again, running maven from command line works fine - I am specifically interested in setting it up as a runner configuration in IntelliJ IDEA.</p>