title: Maven Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3
body: <p>hi im using maven to compile a jersey web services project and im getting error compiling it in windows 2008 server.</p>
  
  <p>Here is the error:</p>
  
  <pre><code>Microsoft Windows [Version 6.1.7601]
  Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
  
  C:\Users\Administrator\Documents\MyApplication&gt;mvn -e exec:java
  [INFO] Error stacktraces are turned on.
  [INFO] Scanning for projects...
  [INFO]
  [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBu
  ilder with a thread count of 1
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building MyApplication 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] --- exec-maven-plugin:1.3:java (default-cli) @ MyApplication ---
  [WARNING] Warning: killAfter is now deprecated. Do you need it ? Please comment on MEXEC-6.
  [WARNING]
  java.lang.ClassNotFoundException: rb.resource.Main
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:281)
          at java.lang.Thread.run(Unknown Source)
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3.244 s
  [INFO] Finished at: 2014-05-31T12:20:54+08:00
  [INFO] Final Memory: 12M/91M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3:java (default-cli) on project
   MyApplication: An exception occured while executing the Java class. rb.resource.Main -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exe
  c-maven-plugin:1.3:java (default-cli) on project MyApplication: An exception occured while executi
  ng the Java class. rb.resource.Main
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBu
  ilder.java:108)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBu
  ilder.java:76)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(Si
  ngleThreadedBuilder.java:51)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the
  Java class. rb.resource.Main
          at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:345)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.j
  ava:133)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
          ... 19 more
  Caused by: java.lang.ClassNotFoundException: rb.resource.Main
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:281)
          at java.lang.Thread.run(Unknown Source)
  [ERROR]
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following arti
  cles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  C:\Users\Administrator\Documents\MyApplication&gt;
  </code></pre>
  
  <p>Here is my maven and java version:</p>
  
  <pre><code>Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-15T01:37:52+08:00)
  Maven home: C:\apache-maven-3.2.1\bin\..
  Java version: 1.8.0_05, vendor: Oracle Corporation
  Java home: c:\Progra~1\Java\jre8
  Default locale: en_SG, platform encoding: Cp1252
  OS name: "windows server 2008 r2", version: "6.1", arch: "amd64", family: "dos"
  </code></pre>
  
  <p>Here is the content for my pom.xml in Windows 2008. The pom.xml content is slightly different mac. (e.g: java version, :</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/maven-v4_0_0.xsd"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;org.company&lt;/groupId&gt;
      &lt;artifactId&gt;MyApplication&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;MyApplication&lt;/name&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.glassfish.jersey&lt;/groupId&gt;
                  &lt;artifactId&gt;jersey-bom&lt;/artifactId&gt;
                  &lt;version&gt;${jersey.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-container-grizzly2-http&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;!-- uncomment this to get JSON support:
           &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-media-moxy&lt;/artifactId&gt;
          &lt;/dependency&gt;
          --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.9&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!--  Gson: Java to Json conversion --&gt;
          &lt;dependency&gt;
            &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
            &lt;artifactId&gt;gson&lt;/artifactId&gt;
            &lt;version&gt;2.2.4&lt;/version&gt;
            &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.6&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Apache Log4J --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.17&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &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;3.1&lt;/version&gt;
                  &lt;inherited&gt;true&lt;/inherited&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                              &lt;classpathPrefix&gt;lib&lt;/classpathPrefix&gt;
                              &lt;mainClass&gt;org.company.Main&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&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.3&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;java&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;mainClass&gt;org.company.Main&lt;/mainClass&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;properties&gt;
          &lt;jersey.version&gt;2.7&lt;/jersey.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>