2014-03-29 40 views
1

我试图配置我的Eclipse(开普勒),当我执行运行 - > Maven Clean,工作。在执行Run as - > Maven Install之后,在控制台中显示下面的错误。执行目标的错误Maven-GWT-Mojo

有解决方案吗?感谢您的关注。

[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.0:compile (default) on project ProjectSetup: Command [[ 
[ERROR] C:\Program Files\Java\jdk1.7.0_51\jre\bin\java -Xmx512m -classpath C:\Dev\ProjectSetup\target\ProjectSetup-0.0.1-SNAPSHOT\WEB-INF\classes;C:\Dev\ProjectSetup\src\main\java;C:\Dev\ProjectSetup\target\generated-sources\gwt;C:\Users\Paulo\.m2\repository\com\google\gwt\gwt-user\2.6.0\gwt-user-2.6.0.jar;C:\Users\Paulo\.m2\repository\org\json\json\20090211\json-20090211.jar;C:\Users\Paulo\.m2\repository\com\github\gwtbootstrap\gwt-bootstrap\2.3.2.0\gwt-bootstrap-2.3.2.0.jar;C:\Users\Paulo\.m2\repository\com\google\gwt\gwt-user\2.6.0\gwt-user-2.6.0.jar;C:\Users\Paulo\.m2\repository\com\google\gwt\gwt-dev\2.6.0\gwt-dev-2.6.0.jar com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war C:\Dev\ProjectSetup\target\ProjectSetup-0.0.1-SNAPSHOT -localWorkers 4 -XfragmentCount -1 -sourceLevel auto -gen C:\Dev\ProjectSetup\target\.generated com.gft.start.projectsetup.ProjectSetup 
[ERROR] ]] failed with status 1 
[ERROR] -> [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 

[编辑]这里我pom.xml中,我需要配置Maven的Eclipse中使用GWT和GWTBootstrap。感谢您的关注并再次提供帮助。

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

    <!-- POM file generated with GWT webAppCreator --> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.gft.start</groupId> 
    <artifactId>ProjectSetup</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>GWT Maven Archetype</name> 

    <properties> 
    <!-- Convenience property to set the GWT version --> 
    <gwtVersion>2.6.0</gwtVersion> 
    <!-- GWT needs at least java 1.5 --> 
    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <dependencies> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-servlet</artifactId> 
     <version>${gwtVersion}</version> 
     <scope>runtime</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-user</artifactId> 
     <version>${gwtVersion}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.7</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.validation</groupId> 
     <artifactId>validation-api</artifactId> 
     <version>1.0.0.GA</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.validation</groupId> 
     <artifactId>validation-api</artifactId> 
     <version>1.0.0.GA</version> 
     <classifier>sources</classifier> 
     <scope>test</scope> 
    </dependency> 
    <!-- Source: http://maven-repository.com/artifact/com.github.gwtbootstrap/gwt-bootstrap/2.3.2.0 --> 
    <dependency> 
     <groupId>com.github.gwtbootstrap</groupId> 
     <artifactId>gwt-bootstrap</artifactId> 
     <version>2.3.2.0</version> 
    </dependency> 
    </dependencies> 

    <build> 
    <!-- Generate compiled stuff in the folder used for developing mode --> 
    <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory> 

    <plugins> 

     <!-- GWT Maven Plugin --> 
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>gwt-maven-plugin</artifactId> 
     <version>2.6.0</version> 
     <executions> 
      <execution> 
      <goals> 
       <goal>compile</goal> 
       <goal>test</goal> 
       <goal>i18n</goal> 
      <!-- <goal>generateAsync</goal> --> 
      </goals> 
      </execution> 
     </executions> 
     <!-- Plugin configuration. There are many available options, see 
      gwt-maven-plugin documentation at codehaus.org --> 
     <configuration> 
      <runTarget>ProjectSetup.html</runTarget> 
      <hostedWebapp>${webappDirectory}</hostedWebapp> 
      <i18nMessagesBundle>com.gft.start.projectsetup.client.Messages</i18nMessagesBundle> 
     </configuration> 
     </plugin> 

     <!-- Copy static web files before executing gwt:run --> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-war-plugin</artifactId> 
     <version>2.1.1</version> 
     <executions> 
      <execution> 
      <phase>compile</phase> 
      <goals> 
       <goal>exploded</goal> 
      </goals> 
      </execution> 
     </executions> 
     <configuration> 
      <webappDirectory>${webappDirectory}</webappDirectory> 
     </configuration> 
     </plugin> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>2.3.2</version> 
     <configuration> 
      <source>1.5</source> 
      <target>1.5</target> 
     </configuration> 
     </plugin> 
    </plugins> 

    <!-- As per: http://stackoverflow.com/a/16275036 --> 
    <pluginManagement> 
     <plugins> 
      <!-- This plugin's configuration is used to store Eclipse m2e settings 
       only. It has no influence on the Maven build itself. --> 
      <plugin> 
       <groupId>org.eclipse.m2e</groupId> 
       <artifactId>lifecycle-mapping</artifactId> 
       <version>1.0.0</version> 
       <configuration> 
        <lifecycleMappingMetadata> 
         <pluginExecutions> 
          <pluginExecution> 
           <pluginExecutionFilter> 
            <groupId>org.codehaus.mojo</groupId> 
            <artifactId>gwt-maven-plugin</artifactId> 
            <versionRange>[2.6.0,)</versionRange> 
            <goals><goal>i18n</goal></goals> 
           </pluginExecutionFilter> 
           <action> 
            <ignore /> 
           </action> 
          </pluginExecution> 
          <pluginExecution> 
           <pluginExecutionFilter> 
            <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-war-plugin</artifactId> 
            <versionRange>[2.1.1,)</versionRange> 
            <goals><goal>exploded</goal></goals> 
           </pluginExecutionFilter> 
           <action> 
            <ignore></ignore> 
           </action> 
          </pluginExecution> 
         </pluginExecutions> 
        </lifecycleMappingMetadata> 
       </configuration> 
      </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 
    </project> 
+0

应该有更具体的消息。 –

+0

专门为'compile mojo'分享你的pom.xml文件的一部分。 – Braj

+0

Maven clean工作正常。接下来转到Maven编译,而不是直接调用Maven install。如果maven编译工作正常,那么请尝试maven包并最后安装maven。这将有助于分析问题。 – Braj

回答

1

尝试让pom.xml下面一个是用于GWT编译。

源代码或类路径或战争目录位置可能存在一些问题。

注:在下面配置了上述日志中的替换版本,并EntryPointClassName,改变JAVA版本1.7也

<build> 
    <sourceDirectory>src/main/java</sourceDirectory> 
    <testSourceDirectory>src/main/test</testSourceDirectory> 
    <resources> 
     <resource> 
      <directory>src/main/resources</directory> 
      <excludes> 
       <exclude>**/*.java</exclude> 
      </excludes> 
     </resource> 
    </resources> 
    <plugins> 
     <plugin> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.3.2</version> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
      </configuration> 
     </plugin> 
     <plugin> 
      <!-- http://mojo.codehaus.org/gwt-maven-plugin/compile-mojo.html --> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>gwt-maven-plugin</artifactId> 
      <version>2.5.0</version> 
      <executions> 
       <execution> 
        <configuration> 
         <extraJvmArgs>-Xmx640M -Xss1024k</extraJvmArgs> 
        </configuration> 
        <goals> 
         <goal>compile</goal> 
         <goal>eclipse</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <optimizationLevel>9</optimizationLevel> 
       <style>DETAILED</style> 
       <warSourceDirectory>src/main/webapp</warSourceDirectory> 
       <modules> 
        <module>com.x.y.z.EntryPointClassName</module> 
       </modules> 
      </configuration> 
     </plugin> 
       ....