title: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli)
body: <p>Im working on <strong>Smooks - Camel Integration</strong>.Im stuck with an error.The Build Fails 
   when I try to Run it using <strong>mvn exec:java</strong></p>
  
  <hr>
  
  <p><strong>[ERROR]:</strong>
      Failed to execute goal <strong>org.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli)</strong> on project 
      camel-example-smooks-integration:</p>
  
  <p><strong>My console log reads as follows:</strong></p>
  
  <pre><code>[ERROR] For more information about the errors and possible solutions, please read the following 
  articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoNotFoundException
  
  C:\apache-camel-2.11.0\examples\camel-example-smooks-integration&gt;mvn exec:java
  [INFO] Scanning for projects...
  [WARNING]
  [WARNING] Some problems were encountered while building the effective model for
  org.apache.camel:camel-example-smooks-integration:bundle:2.11.0
  [WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate   
  declaration of plugin org.codehaus.mojo:exec-maven-plugin @ line 138, column 9
  
  [WARNING]
  [WARNING] It is highly recommended to fix these problems because they threaten the stability of 
   your build.
  
  [WARNING]
  [WARNING] For this reason, future Maven versions might no longer support building such malformed 
  projects.
  
  [WARNING]
  
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building CAMEL SMOOKS-INTEGRATION 2.11.0
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] &gt;&gt;&gt; exec-maven-plugin:1.2:java (default-cli) @ camel-example-smooks-integration &gt;&gt;&gt;
  [INFO]
  [INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @ camel-example-smooks-
   integration ---
  [INFO]
  [INFO] &lt;&lt;&lt; exec-maven-plugin:1.2:java (default-cli) @ camel-example-smooks-integration &lt;&lt;&lt;
  [INFO]
  [INFO] --- exec-maven-plugin:1.2:java (default-cli) @ camel-example-smooks-integration ---
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3.229s
  [INFO] Finished at: Thu Aug 01 20:29:09 IST 2013
  [INFO] Final Memory: 9M/22M
  [INFO] ------------------------------------------------------------------------
  
  [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli) on    
  project camel-example-smooks-integration: An exception occured while executing the Java class. 
  C:\apache-camel-2.11.0\examples\camel-example-smooks -integration\src\main\java\example\Main -&gt; 
  [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [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 
  articles:
  
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p><strong>My POM.xml reads as follows:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &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;parent&gt;
          &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
          &lt;artifactId&gt;examples&lt;/artifactId&gt;
          &lt;version&gt;2.11.0&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;artifactId&gt;camel-example-smooks-integration&lt;/artifactId&gt;
      &lt;packaging&gt;bundle&lt;/packaging&gt;
      &lt;name&gt;CAMEL SMOOKS-INTEGRATION&lt;/name&gt;
  
      &lt;description&gt;An example for showing Camel Smooks Integration&lt;/description&gt;
  
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-spring&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.milyn&lt;/groupId&gt;
              &lt;artifactId&gt;milyn-smooks-core&lt;/artifactId&gt;
              &lt;version&gt;1.5.1&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-lang&lt;/groupId&gt;
              &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
              &lt;version&gt;2.6&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;version&gt;1.1.3&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.5.1&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- logging --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!-- for testing --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-test&lt;/artifactId&gt;
              &lt;version&gt;2.0-M3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
  
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;attach-artifacts&lt;/id&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;attach-artifact&lt;/goal&gt;
                          &lt;/goals&gt;
  
  
                          &lt;configuration&gt;
                              &lt;artifacts&gt;
                                  &lt;artifact&gt;
                                      &lt;file&gt;target/classes/features.xml&lt;/file&gt; 
                                      &lt;type&gt;xml&lt;/type&gt;
                                      &lt;classifier&gt;features&lt;/classifier&gt;
                                  &lt;/artifact&gt;
                              &lt;/artifacts&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;  
                  &lt;/executions&gt;
              &lt;/plugin&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;2.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.7&lt;/source&gt;
                      &lt;target&gt;1.7&lt;/target&gt;
                      &lt;compilerArgument&gt;-proc:none&lt;/compilerArgument&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.2.1&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;C:\apache-camel-2.11.0\examples\camel-example-smooks-  
                          integration\src\main\java\example\Main&lt;/mainClass&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.13&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;skipTests&gt;true&lt;/skipTests&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.7&lt;/version&gt;
                  &lt;extensions&gt;true&lt;/extensions&gt;
                  &lt;configuration&gt;
                      &lt;instructions&gt;
                          &lt;Bundle-SymbolicName&gt;osgi.org.springframework.batch&lt;/Bundle-SymbolicName&gt;
                          &lt;Export-Package&gt;*&lt;/Export-Package&gt;
                          &lt;Import-Package&gt;*&lt;/Import-Package&gt;
                      &lt;/instructions&gt;
                      &lt;unpackBundle&gt;true&lt;/unpackBundle&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.2&lt;/version&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
  
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>I've tried following things so far to eliminate this error, havent got any success yet.</strong></p>
  
  <pre><code>1.DownGraded the JDK from  Version 1.7 to jdk1.6.0_18
  
  2.Added the **main class** in the **plugin for org.codehaus.mojo**
  
            &lt;configuration&gt;
              &lt;mainClass&gt;C:\apache-camel-2.11.0\examples\camel-example-smooks-integration\src\main\java\example\Main&lt;/mainClass&gt;
          &lt;/configuration&gt;
  </code></pre>