title: how to set pom.xml to run main class in maven project in netbeans
body: <p>May I ask what I should do to run main class in a maven project created in Netbeans IDE? I set the pom.xml like the following, but it doesn't work.Is there any other configuration in Netbeans I should modify?</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
   &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
   &lt;artifactId&gt;mavenproject2&lt;/artifactId&gt;
   &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
  
   &lt;name&gt;mavenproject2&lt;/name&gt;
   &lt;url&gt;http://maven.apache.org&lt;/url&gt;
      &lt;build&gt;
          &lt;plugins&gt;
             &lt;!-- &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.7&lt;/source&gt;
                      &lt;target&gt;1.7&lt;/target&gt;
                  &lt;/configuration&gt;
                &lt;/plugin&gt; --&gt;
            &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.2.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;mainClass&gt;com.mycompany.mavenproject2.App&lt;/mainClass&gt;               
              &lt;/configuration&gt;
            &lt;/plugin&gt;  
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.10&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;properties&gt;
     &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>