How to create a Maven project from java program(Automatically)? : <p>Java 1.7</p>

<p>I want to write a program which should generate the Maven Project.</p>

<p>For Example:</p>

<pre><code>public class AutoGenerate{
   public static void main(String[] args){
     // Here I will ask all the user input params like project name, location and group id and etc

   // Need to write code which should generate a dummy maven structure project.
   }
}
</code></pre>
