Java – you cannot successfully create a project using GWT Maven plugin with GWT 2.2

I am completing a GWT project according to the documents of GWT Maven plugin and Google Web toolkit blog, but it is not successful

Using eclipse 3.6, I use archetype GWT Maven plugin 2.1 0-1 created a new Maven project

I follow the instructions found here, Google Web toolkit blog, but it doesn't work I get an exception:

java.lang.NoClassDefFoundError: com/google/appengine/tools/enhancer/Enhance
Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.enhancer.Enhance
    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 sun.misc.Launcher$AppClassLoader.loadClass(UnkNown Source)
    at java.lang.ClassLoader.loadClass(UnkNown Source)
Exception in thread "main" 

I use gae 1.4 in the Google Eclipse Plug-in GWT 2.2 in 2 0. My POM The same version number is used in the XML

This is the generated POM xml. It uses 2.1 0 version of GWT, but I manually changed it to 2.2 0

<?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>gwt-comet</groupId>
  <artifactId>gwt-comet-5</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.2.0</gwtVersion>
    <!-- GWT needs at least java 1.5 -->
    <maven.compiler.source>1.5</maven.compiler.source>
    <maven.compiler.target>1.5</maven.compiler.target>
    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
      <version>2.2.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>2.2.0</version>
      <scope>provided</scope>
    </dependency>  
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.7</version>
      <scope>test</scope>
    </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.1.0-1</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>Comet.html</runTarget>
          <hostedWebapp>${webappDirectory}</hostedWebapp>
          <i18nMessagesBundle>fr.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>

    </plugins>
  </build>

</project>

Thanks for your help.

Solution

I don't use it with gae, but there is an updated version of GWT Maven plugin for 2.2 Set it to 2.2 0 or delete the version tag, it will get the latest tag There are no gae dependencies in your POM

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>