title: How to execute sonar command line in NAnt
body: <p>I want to use NAnt to execute sonar to scan my C# code. The sonar command line is "mvn sonar:sonar", in which 'mvn' is the command name, 'sonar:sonar' is the user name and password.
  I tried two ways to execute it:</p>
  
  <p>1.</p>
  
  <pre><code>&lt;target name="buildOM" description="......"&gt;
      &lt;exec program="mvn" workingdir="C:\codes\projects\helloworld"&gt;
          &lt;arg value="sonar:sonar"/&gt;
      &lt;/exec&gt;
  &lt;/exec&gt;
  </code></pre>
  
  <p></p>
  
  <p>2.</p>
  
  <pre><code>&lt;target name="buildOM" description="......"&gt;
      &lt;exec program="mvn sonar:sonar" workingdir="C:\codes\projects\helloworld"&gt;
      &lt;/exec&gt;
  &lt;/exec&gt;
  </code></pre>
  
  <p></p>
  
  <p>But these do not work. I found 'input' tag for Ant. "<a href="https://stackoverflow.com/questions/7146063/ant-passing-username-and-password-to-exec">Ant : Passing username and password to exec</a>". But I cannot find it in NAnt help document.
  I try to search the solution in the internet for 2 days, but failed.</p>
  
  <p>Could you help me how to resolve it ? 
  Thank you.</p>