Maven + GAE循序渐进

Fabio B .:

我正在寻找有关如何“修饰”由Google Eclipse插件创建的Google AppEngine项目的基础教程。

如果太难了,如何创建一个Maven项目,向它添加GAE支持,然后将其导入Eclipse并从那里使用GooglePlugin?

ps如果我也想要SpringMVC怎么办?

伊戈尔·阿尔塔莫诺夫(Igor Artamonov):

我不确定如何从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

开发服务器可以通过启动mvn gae:run,部署mvn gae:deploy

要使用Spring,请将依赖项添加到工件spring-webmvcspring-corespring-context在group下org.springframework

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章