title: Debugging in maven with mvnDebug command
body: <p>I read this:
  <a href="https://stackoverflow.com/questions/2935375/debugging-in-maven">Debugging in Maven?</a></p>
  
  <p>I'm running intellij remote debug and maven for a service I'm trying to debug. </p>
  
  <p>I'm running </p>
  
  <pre><code>mvnDebug tomcat7:run 
  </code></pre>
  
  <p>Which gives me the following result</p>
  
  <pre><code>Preparing to Execute Maven in Debug Mode
  Listening for transport dt_socket at address: 8000
  ^Ctai-m:sb-api-internal-server tai$ m
  </code></pre>
  
  <p>My problem is that I want to change the port easily. I know that I can go into the pom.xml file and change it or that I can do the following in:</p>
  
  <p>mvnDebug.bat </p>
  
  <pre><code>@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
  </code></pre>
  
  <p>but I want to be able to specify my port on the command line. Is there any way to do this? I want to be able to debug multiple services on different addresses running at once and am under the impression that it would be a hassle to have to set and reset the debug file setting for each one.</p>
  
  <p>A friend said it should be possible but I can't seem to find a solution.</p>
  
  <p>Essentially Im looking for a way to easily switch the port a service is running on hopefully without modifying a file multiple times as I launch multiple services. Otherwise Is there another solution you can thing of? Ex having the first debug instance running on one port and then having the second on another (hard coded)?</p>
  
  <p>Thanks</p>