title: How to execute Allure command using Java
body: <p>I want to generate test case wise reports in respective folder. So for example if I run login test case , it's allure html report should save in /reports/login.</p>
  
  <p>I can do it easily by executing below command manually once my test execution completes. Command I use is : </p>
  
  <pre><code>allure generate allure-results -o E:\project\target\reports\loginReport --clean
  </code></pre>
  
  <p>But here difficulty is I have to execute command manually every time to generate report.</p>
  
  <p>So I decided to execute this allure command from java , I tried following code :</p>
  
  <pre><code> String cmd = "allure generate allure-results -o E:\\project\target\\reports\\loginReport --clean";
   Process process = Runtime.getRuntime().exec(cmd);
   process.waitFor();
  </code></pre>
  
  <p>I am calling above code as last test in my code. But getting error :</p>
  
  <pre><code>java.io.IOException: Cannot run program "allure": CreateProcess error=2, The system cannot find the file specified
  </code></pre>
  
  <p>so question is how can I execute above command from my java code. I am using Java, selenium, TestNG and maven. </p>
  
  <p><strong>Note :</strong> I have already set class path for allure package.</p>