梅文 + GAE 一步一步

发布于 2024-12-11 17:49:15 字数 186 浏览 0 评论 0原文

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

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

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

I'm looking for a basic tutorial on how to "mavenize" a Google AppEngine project, created by Google Eclipse Plugin.

In case that's too difficult, how to create a Maven project, add GAE support to it then import it into Eclipse and work with the GooglePlugin from there?

P.s. What if I wanted SpringMVC,too?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蘸点软妹酱 2024-12-18 17:49:15

我不确定如何从 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 gae 启动:运行,通过mvn gae:deploy部署

要使用Spring,请将依赖项添加到工件spring-webmvcspring-coreorg.springframework 组下的 spring-context

I'm not sure how to create maven project from eclipse, but creating it from scratch is very easy. For gae you can use net.kindleit:maven-gae-plugin See http://www.kindleit.net/maven_gae_plugin/index.html, it can generate pom.xml for you. Or just use it as

<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> 

but don't forget to add GAE dependencies:

    <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>

and repositories:

<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>

and then you can generate eclipse config by using mvn eclipse:eclipse

Dev server can be started by mvn gae:run, deployment by mvn gae:deploy

To use Spring, add dependencies to artifacts spring-webmvc, spring-core and spring-context under group org.springframework

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文