2012-12-27 53 views
1

我已經創建了gwt maven項目,現在我想編譯它並運行它。爲了comiple我提供gwt:compile爲目標並運行gwt:run,但它給我建立失敗,出現異常:目標org.codehaus.mojo的參數'runTarget':gwt-maven-plugin:2.5.0:run缺失或無效

[INFO] [INFO] >>> GWT-Maven的插件:2.5.0:運行(默認-cli)@ engilev2_with_maven >>> [INFO]
[INFO] --- 行家資源-插件:2.5:資源(缺省資源)@ engilev2_with_maven --- [調試]執行所情境
[INFO ]使用'UTF-8'編碼使用 複製過濾的資源。
[INFO]複製3個 資源[INFO]
[INFO] ---行家編譯-插件:2.5.1:編譯(默認編譯)@ engilev2_with_maven ---
[INFO]將源文件編譯到/根/ 18julyWorkspace/engilev2_with_maven /目標/ EngileNightly/WEB-INF /類
[INFO] < < < GWT-行家-插件:2.5.0:運行(缺省CLI)@ engilev2_with_maven < < < [INFO]
[INFO] --- gwt-maven-plugin:2.5.0:run(default-cli)@ engilev2_with_maven ---
[INFO] ----------------- ----------------------------- --------------------------
[INFO] BUILD FAILURE
[INFO] ------------ -------------------------------------------------- ----------
[INFO] Total time:4.128s [INFO]完成日期:Thu Dec 27 12:01:34 IST 2012
[INFO] Final Memory:18M/131M
[ INFO] ------------------------------------------------ ------------------------
[警告]請求的配置文件「default」無法激活,因爲它不存在。
[錯誤]未能執行目標org.codehaus.mojo:GWT-Maven的插件:2.5.0:運行(默認CLI)項目
engilev2_with_maven:參數 'runTarget' 爲目標 org.codehaus.mojo :gwt-maven-plugin:2.5.0:運行丟失或無效 - >
[幫助1] [錯誤]
[錯誤]要查看錯誤的完整堆棧跟蹤,請使用-e開關。
[錯誤]使用-X
開關重新運行Maven以啓用完全調試日誌記錄。

我不明白是什麼問題就在這裏

出海。XML :::

<?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>engilev2_with_maven</groupId> 
    <artifactId>engilev2_with_maven</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.4.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> 
     <!-- <dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-user</artifactId> 
      <version>${gwtVersion}</version> <scope>provided</scope> </dependency> --> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-simple</artifactId> 
      <version>1.6.1</version> 
     </dependency> 
     <dependency> 
      <groupId>appops_shared</groupId> 
      <artifactId>appops_shared</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>appops_client</groupId> 
      <artifactId>appops_client</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>appops_server</groupId> 
      <artifactId>appops_server</artifactId> 
      <version>1.0</version> 
     </dependency> 

     <dependency> 
      <groupId>commons-codec</groupId> 
      <artifactId>commons-codec</artifactId> 
      <version>1.7</version> 
     </dependency> 
     <dependency> 
      <groupId>commons-collections</groupId> 
      <artifactId>commons-collections</artifactId> 
      <version>3.2.1</version> 
     </dependency> 
     <dependency> 
      <groupId>mysql</groupId> 
      <artifactId>mysql-connector-java</artifactId> 
      <version>5.1.21</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.lucene</groupId> 
      <artifactId>lucene-core</artifactId> 
      <version>3.4.0</version> 
     </dependency> 
     <dependency> 
      <groupId>local.mvp4g</groupId> 
      <artifactId>mvp4g</artifactId> 
      <version>1.4.0</version> 
     </dependency> 
     <!-- <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> 
      <version>3.0</version> </dependency> --> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-annotations</artifactId> 
      <version>3.5.6-Final</version> 
     </dependency> 
     <dependency> 
      <groupId>aopalliance</groupId> 
      <artifactId>aopalliance</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>commons-fileupload</groupId> 
      <artifactId>commons-fileupload</artifactId> 
      <version>1.2</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.gwt.inject</groupId> 
      <artifactId>gin</artifactId> 
      <version>2.0.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.reflections</groupId> 
      <artifactId>reflections</artifactId> 
      <version>0.9.8</version> 
     </dependency> 
     <dependency> 
      <groupId>com.googlecode.gwtupload</groupId> 
      <artifactId>gwtupload</artifactId> 
      <version>0.6.4</version> 
     </dependency> 

     <dependency> 
      <groupId>javax.mail</groupId> 
      <artifactId>mailapi</artifactId> 
      <version>1.4.3</version> 
     </dependency> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-core</artifactId> 
      <version>3.6.0.Final</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.inject</groupId> 
      <artifactId>javax.inject</artifactId> 
      <version>1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-validator</artifactId> 
      <version>4.1.0.Final</version> 
     </dependency> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-commons-annotations</artifactId> 
      <version>3.2.0.Final</version> 
     </dependency> 
     <!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> 
      <version>1.6.1</version> </dependency> --> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
      <version>1.6.1</version> 
     </dependency> 
     <dependency> 
      <groupId>log4j</groupId> 
      <artifactId>log4j</artifactId> 
      <version>1.2.16</version> 

     </dependency> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-log4j12</artifactId> 
      <version>1.6.1</version> 
     </dependency> 
     <dependency> 
      <groupId>com.googlecode.gwtphonegap</groupId> 
      <artifactId>gwtphonegap</artifactId> 
      <version>1.8.1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.atmosphere</groupId> 
      <artifactId>atmosphere-gwt-server</artifactId> 
      <version>1.0.1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.atmosphere</groupId> 
      <artifactId>atmosphere-gwt-poll</artifactId> 
      <version>1.0.1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.atmosphere</groupId> 
      <artifactId>atmosphere-gwt-common</artifactId> 
      <version>1.0.1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.atmosphere</groupId> 
      <artifactId>atmosphere-compat-tomcat</artifactId> 
      <version>1.0.1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.atmosphere</groupId> 
      <artifactId>atmosphere-compat-tomcat7</artifactId> 
      <version>1.0.1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.atmosphere</groupId> 
      <artifactId>atmosphere-compat-jbossweb</artifactId> 
      <version>1.0.1</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.inject</groupId> 
      <artifactId>guice</artifactId> 
      <version>3.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.inject.extensions</groupId> 
      <artifactId>guice-assisted-inject</artifactId> 
      <version>2.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.inject.extensions</groupId> 
      <artifactId>guice-servlet</artifactId> 
      <version>3.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.oauth-client</groupId> 
      <artifactId>google-oauth-client</artifactId> 
      <version>1.11.0-beta</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.oauth-client</groupId> 
      <artifactId>google-oauth-client-servlet</artifactId> 
      <version>1.11.0-beta</version> 
     </dependency> 
     <dependency> 
      <groupId>org.atmosphere</groupId> 
      <artifactId>atmosphere-runtime</artifactId> 
      <version>1.0.1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.atmosphere</groupId> 
      <artifactId>atmosphere-gwt-client</artifactId> 
      <version>1.0.1</version> 
     </dependency> 

     <dependency> 
      <groupId>net.sf.ehcache</groupId> 
      <artifactId>ehcache</artifactId> 
      <version>1.5.0</version> 
     </dependency> 
     <dependency> 
      <groupId>c3p0</groupId> 
      <artifactId>c3p0</artifactId> 
      <version>0.9.1.2</version> 
     </dependency> 

     <dependency> 
      <groupId>gwt-oauth2</groupId> 
      <artifactId>gwt-oauth2</artifactId> 
      <version>0.2</version> 
      <classifier>alpha</classifier> 
     </dependency> 
     <dependency> 
      <groupId>com.google.code.gson</groupId> 
      <artifactId>gson</artifactId> 
      <version>2.1</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.gwt</groupId> 
      <artifactId>gwt-dev</artifactId> 
      <version>${gwtVersion}</version> 
      <type>jar</type> 
      <scope>compile</scope> 
     </dependency> 
    </dependencies> 

    <build> 
     <finalName>EngileNightly</finalName> 
     <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory> 
     <plugins> 
      <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.5.0,)</versionRange> --> 
            <version>${gwtVersion}</version> 
            <goals> 
             <goal>resources</goal> 
             <goal>compile</goal> 
             <goal>i18n</goal> 
             <goal>generateAsync</goal> 
            </goals> 
            <configuration> 
             <modules> 
              <module>com.engile.Engile</module> 
             </modules> 
            </configuration> 
           </pluginExecutionFilter> 
           <action> 
            <execute /> 
           </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> 
            <execute /> 
           </action> 
          </pluginExecution> 

         </pluginExecutions> 
        </lifecycleMappingMetadata> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.5.1</version> 
       <configuration> 
        <source>1.5</source> 
        <target>1.5</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

</project> 
+0

請添加您的pom.xml。 – asgoth

+0

我已編輯我的問題PLZ看看。 – pbhle

+0

插件的任何特定原因 - gwt-maven-plugin未配置? – SSR

回答

2

您需要配置<runTarget>標籤下<plugin>標籤爲<artifactId>gwt-maven-plugin</artifactId>

  <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>gwt-maven-plugin</artifactId> 
       <version>2.4.0</version> 
       <executions> 
        <execution> 
         <goals> 
          <goal>compile</goal> 
          <goal>test</goal> 
         </goals> 
        </execution> 
       </executions> 
       <!-- Plugin configuration. There are many available options, see gwt-maven-plugin 
        documentation at codehaus.org --> 
       <configuration> 
        <runTarget>index.html</runTarget> 
        <hostedWebapp>${webappDirectory}</hostedWebapp> 
       </configuration> 
      </plugin> 

檢查如何設置Maven的GWT示例項目樣本GWT項目http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/

GWT和WorkingWithMaven - http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven

1

你可以用M avem proprties: mvn gwt:run -DrunTarget=Application.jsp

相關問題