Java 无法使用带有GWT2.2的GWT maven插件成功创建项目

Java 无法使用带有GWT2.2的GWT maven插件成功创建项目,java,eclipse,gwt,maven,maven-plugin,Java,Eclipse,Gwt,Maven,Maven Plugin,我正在遵循的文档以及上的文档,以便将GWT项目mavenized,但没有成功 使用Eclipse3.6,我使用原型GWTMaven插件2.1.0-1创建了一个新的maven项目 我按照这里的说明做了,但没用。我得到一个例外: java.lang.NoClassDefFoundError: com/google/appengine/tools/enhancer/Enhance Caused by: java.lang.ClassNotFoundException: com.google.appen

我正在遵循的文档以及上的文档,以便将GWT项目mavenized,但没有成功

使用Eclipse3.6,我使用原型GWTMaven插件2.1.0-1创建了一个新的maven项目

我按照这里的说明做了,但没用。我得到一个例外:

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" java.lang.NoClassDefFoundError:com/google/appengine/tools/enhancer/Enhance 原因:java.lang.ClassNotFoundException:com.google.appengine.tools.enhancer.enhancer 位于java.net.URLClassLoader$1.run(未知源) 位于java.security.AccessController.doPrivileged(本机方法) 位于java.net.URLClassLoader.findClass(未知源) 位于java.lang.ClassLoader.loadClass(未知源) 位于sun.misc.Launcher$AppClassLoader.loadClass(未知源) 位于java.lang.ClassLoader.loadClass(未知源) 线程“main”中出现异常 我在谷歌eclipse插件的GAE1.4.2中使用GWT2.2.0。我的pom.xml中使用了相同的版本号

下面是生成的pom.xml文件。它使用gwt的2.1.0版本,但我手动将其更改为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> 4.0.0 gwt彗星 gwt-comet-5 战争 0.0.1-快照 GWT Maven原型 2.2.0 1.5 1.5 ${project.build.directory}/${project.build.finalName} com.google.gwt gwt servlet 2.2.0 运行时 com.google.gwt gwt用户 2.2.0 假如 朱尼特 朱尼特 4.7 测试 ${webappDirectory}/WEB-INF/classes org.codehaus.mojo GWTMaven插件 2.1.0-1 编译 测试 i18n 生成同步 Comet.html ${webappDirectory} fr.client.Messages org.apache.maven.plugins maven战争插件 2.1.1 编译 爆炸了的 ${webappDirectory}
谢谢你的帮助。

我还没有在GAE中使用它,但是有一个更新版本的gwt maven插件用于2.2。将其设置为2.2.0或删除版本标记,它将获取最新版本。
您的pom中也没有对GAE的任何依赖关系。

我使用这个原型来创建项目结构。只需填写groupid和artifactid以及artifact版本的名称。
mvn-B原型:generate-DarchetypeGroupId=org.codehaus.mojo-DarchetypeArtifactId=gwt maven plugin-DarchetypeVersion=2.2-DgroupId=org.dpdouran.web-DartifactId=WebERP-Dversion=1.0-SNAPSHOT-Dmodule=WebERP
!谢谢。此外,由于jBoss开发人员的错误,我不得不手动更改Documents and Settings\redsonic\.m2\repository\org\codehaus\mojo\gwt-maven-plugin\2.2.0中的gwt-maven-plugin-2.2.0.pom请参见此处的详细信息和说明: