2013-08-02 21 views
23

Im arbeitet an Smooks - Kamel Integration .Im mit einem Fehler haben.Kamera Körperbau stecken schlägt fehl wenn ich versuche, ausführen es mvn exec: JavaFehlgeschlagen Ziel org.codehaus.mojo auszuführen: exec-Maven-Plugin: 1.2: Java (Standard-cli)


[ERROR]: Fehler beim ausführen Ziel org.codehaus.mojo: exec-maven-Plugin: 1.2: Java (Standard-cli) zum Projekt camel-example-smooks-integration:

Mein Konsolenprotokoll lautet wie folgt:

[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>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] >>> exec-maven-plugin:1.2:java (default-cli) @ camel-example-smooks-integration >>> 
[INFO] 
[INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @ camel-example-smooks- 
integration --- 
[INFO] 
[INFO] <<< exec-maven-plugin:1.2:java (default-cli) @ camel-example-smooks-integration <<< 
[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 -> 
[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 

Meine pom.xml lauten wie folgt:

<?xml version="1.0" encoding="UTF-8"?> 

<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"> 

    <modelVersion>4.0.0</modelVersion> 

    <parent> 
     <groupId>org.apache.camel</groupId> 
     <artifactId>examples</artifactId> 
     <version>2.11.0</version> 
    </parent> 

    <artifactId>camel-example-smooks-integration</artifactId> 
    <packaging>bundle</packaging> 
    <name>CAMEL SMOOKS-INTEGRATION</name> 

    <description>An example for showing Camel Smooks Integration</description> 


    <dependencies> 
     <dependency> 
      <groupId>org.apache.camel</groupId> 
      <artifactId>camel-spring</artifactId> 
     </dependency> 


     <dependency> 
      <groupId>org.milyn</groupId> 
      <artifactId>milyn-smooks-core</artifactId> 
      <version>1.5.1</version> 
     </dependency> 



     <dependency> 
      <groupId>commons-lang</groupId> 
      <artifactId>commons-lang</artifactId> 
      <version>2.6</version> 
     </dependency> 

     <dependency> 
      <groupId>commons-logging</groupId> 
      <artifactId>commons-logging</artifactId> 
      <version>1.1.3</version> 
     </dependency> 



     <dependency> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.5.1</version> 
     </dependency> 


     <!-- logging --> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-log4j12</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>log4j</groupId> 
      <artifactId>log4j</artifactId> 
     </dependency> 

     <!-- for testing --> 

     <dependency> 
      <groupId>org.apache.camel</groupId> 
      <artifactId>camel-test</artifactId> 
      <version>2.0-M3</version> 
     </dependency> 

     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 

      <scope>test</scope> 
     </dependency> 
    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>build-helper-maven-plugin</artifactId> 
       <executions> 
        <execution> 
         <id>attach-artifacts</id> 
         <phase>package</phase> 
         <goals> 
          <goal>attach-artifact</goal> 
         </goals> 


         <configuration> 
          <artifacts> 
           <artifact> 
            <file>target/classes/features.xml</file> 
            <type>xml</type> 
            <classifier>features</classifier> 
           </artifact> 
          </artifacts> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 



      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.1</version> 
       <configuration> 
        <source>1.7</source> 
        <target>1.7</target> 
        <compilerArgument>-proc:none</compilerArgument> 
       </configuration> 
      </plugin> 


      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>exec-maven-plugin</artifactId> 
       <version>1.2.1</version> 
       <executions> 
        <execution> 
         <goals> 
          <goal>java</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <mainClass>C:\apache-camel-2.11.0\examples\camel-example-smooks- 
         integration\src\main\java\example\Main</mainClass> 
       </configuration> 
      </plugin> 


      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-failsafe-plugin</artifactId> 
       <version>2.13</version> 
       <configuration> 
        <skipTests>true</skipTests> 
       </configuration> 
      </plugin> 


      <plugin> 
       <groupId>org.apache.felix</groupId> 
       <artifactId>maven-bundle-plugin</artifactId> 
       <version>2.3.7</version> 
       <extensions>true</extensions> 
       <configuration> 
        <instructions> 
         <Bundle-SymbolicName>osgi.org.springframework.batch</Bundle-SymbolicName> 
         <Export-Package>*</Export-Package> 
         <Import-Package>*</Import-Package> 
        </instructions> 
        <unpackBundle>true</unpackBundle> 
       </configuration> 
      </plugin> 



      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>exec-maven-plugin</artifactId> 
       <version>1.2</version> 
      </plugin> 
     </plugins> 

    </build> 
</project> 

ich folgende Dinge ausprobiert habe, so weit, diese Fehler zu beseitigen Habe noch keinen Erfolg.

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** 

      <configuration> 
      <mainClass>C:\apache-camel-2.11.0\examples\camel-example-smooks-integration\src\main\java\example\Main</mainClass> 
     </configuration> 
+0

Auf der Suche nach Vorschlägen, um dieses Problem zu beheben –

+0

Versuchen Sie 'mvn -X exec: java', um die vollständige Debugging-Protokollierung zu aktivieren, sollten Sie weitere Informationen haben – Pith

+1

Alle Nachrichten dazu? – streetlight

Antwort

5

Ihr Problem ist, dass Sie die exec-Maven-Plugin zweimal haben deklarieren:

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>exec-maven-plugin</artifactId> 
    <version>1.2.1</version> 
    <executions> 
     <execution> 
      <goals> 
       <goal>java</goal> 
      </goals> 
     </execution> 
    </executions> 
    <configuration> 
     <mainClass>C:\apache-camel-2.11.0\examples\camel-example-smooks- 
     integration\src\main\java\example\Main< /mainClass> 
    </configuration> 
</plugin> 

...

< plugin> 
    < groupId>org.codehaus.mojo</groupId> 
    < artifactId>exec-maven-plugin</artifactId> 
    < version>1.2</version> 
< /plugin> 
+0

Hey Pith, ich habe versucht, die doppelten Einträge für < groupId> org.codehaus.mojo löschen immer noch mit demselben Fehler: –

+0

Sie haben das gesamte Plugin löschen, nicht nur die GroupId? – Pith

1

ich hatte das gleiche Problem, aber nach dem alten Löschen Plugin für org.codehaus.mojo hat funktioniert.

Ich benutze diese

 <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>exec-maven-plugin</artifactId> 
      <version>1.2</version> 
     </plugin> 
5

Ich hatte ein ähnliches Problem.

Wie sich herausstellte, lief ich mvn sauberes Paket installieren.

richtige Weg ist mvn sauber

0

installiere ich ein ähnliches Problem mit 'org.codehaus.mojo' hatte - 'jaxws-Maven-Plugin': konnte nicht Abhängigkeiten auflösen. Glücklicherweise konnte ich ein Projekt> Säubern in Eclipse durchführen, wodurch das Problem gelöst wurde.