Maven + GAE步骤
我正在寻找关于如何“谷歌化”由Google Eclipse Plugin创建的Google AppEngine项目的基本教程。
如果这太困难了,如何创建一个Maven项目,添加GAE支持,然后将其导入Eclipse并从那里使用GooglePlugin?
Ps如果我还想要SpringMVC呢?
我不知道如何从eclipse创建maven项目,但从头开始创建它非常简单。 对于gae,您可以使用net.kindleit:maven-gae-plugin
请参阅http://www.kindleit.net/maven_gae_plugin/index.html,它可以为您生成pom.xml
。 或者只是用它
<plugin>
<groupId>net.kindleit</groupId>
<artifactId>maven-gae-plugin</artifactId>
<version>0.8.4</version>
<configuration>
<port>8080</port>
<address>127.0.0.1</address>
</configuration>
<executions>
<execution>
<id>start-gae</id>
<goals>
<goal>stop</goal>
<goal>unpack</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-gae</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
但不要忘记添加GAE依赖关系:
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${gae.version}</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-labs</artifactId>
<version>${gae.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>${gae.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>${gae.version}</version>
<scope>test</scope>
</dependency>
和存储库:
<pluginRepositories>
<pluginRepository>
<id>maven-gae-plugin-repo</id>
<name>maven-gae-plugin repository</name>
<url>http://maven-gae-plugin.googlecode.com/svn/repository</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>maven-gae-plugin-repo</id>
<name>maven-gae-plugin repository</name>
<url>http://maven-gae-plugin.googlecode.com/svn/repository</url>
</repository>
</repositories>
然后你可以使用mvn eclipse:eclipse
生成eclipse配置mvn eclipse:eclipse
开发服务器可以由mvn gae:run
启动mvn gae:run
,通过mvn gae:deploy
为了使用Spring,在组org.springframework
下面添加对工件spring-webmvc
, spring-core
和spring-context
依赖
上一篇: Maven + GAE step