我想使用maven进行GAE项目

我想使用maven进行GAE项目

本文介绍了我想使用maven进行GAE项目,我该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是GAE世界的新人。我使用eclipse和GAE的SDK,我可以使用GAE图标部署到云端,一切都很好。当我必须导入无限数量的依赖项时,出现问题,那么我想为此使用maven。我发现有一个特殊的GAE maven插件,叫做:
maven-gae-plugin



我可以使用常规的maven 来获取依赖关系

感谢

解决方案

您需要为声明依赖项目的项目定义一个pom.xml。

当您使用maven构建时,依赖关系将从远程存储库下载并存储在本地存储库$ {userhome} /。m2 / repository。

maven构建还将绑定war文件中的依赖关系。



最简单的入门方式是使用原型创建项目结构。



目前为止,我已经尝试过两个原型:


  1. gae-archetype-gwt,它是在gae-maven-plugin附近构建的,见。

  2. gae-eclipse-maven-archetype,请参阅这个,并注意helios更新文章顶部的链接。

如名称所示,gae-eclipse-maven-archetype更好地支持eclipse,我发现maven和eclipse的配置已经发生冲突相互之间,哪个gae-eclipse-maven-archetype有很长的路要缓解。



如果您当前的项目没有使用,那么你将要进行艰苦的战斗。如果您尝试使用默认值,这些默认选项大部分是明智的选项,而不是针对粒度,并且必须覆盖所有默认配置选项,那么Maven项目更容易配置。


i'm new in the world of GAE. I 'm using eclipse and GAE's SDK, i can deploy to the cloud with the GAE icon and everything is fine. The problem arises when I have to import the infinite number of dependency, then I want to use maven for that. I discovered that there is a special GAE maven plugin called:maven-gae-plugin

Can I use regular maven only to fetch dependencys or I have to use the GAE special plugin to do this?

Thanks

解决方案

You'll need to define a pom.xml for the project which declares the dependencies.
When you build with maven the dependencies will be downloaded from the remote repositories and stored in you local repository ${userhome}/.m2/repository.
The maven build will also bindle the dependencies in your war file.

The easiest way to get started is by creating a project structure using an archetype.

There are 2 archetypes that I've tried for gae so far:

  1. gae-archetype-gwt, which is built adjacent to the gae-maven-plugin, see this article.
  2. gae-eclipse-maven-archetype, see this article and also note the link at the top of the article for the helios update.

As the name suggests gae-eclipse-maven-archetype has better support for eclipse, I have been finding that the configurations for maven and eclipse have been clashing with each other, which gae-eclipse-maven-archetype goes a long way to alleviate.

If your current project is not using the maven directory structure, then you are going to have an uphill battle. Maven projects are easier to configure if you try to fit in with the defaults which are largely sensible options, rather than going against the grain and having to override all of the default configuration options.

这篇关于我想使用maven进行GAE项目,我该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 14:22