简体   繁体   English

我可以在Maven Gae项目中使用Google App Engine eclipse插件吗?

[英]Can i use the google app engine eclipse plugin with a maven gae project?

I migrated a GAE project to a Maven project with the official way ( https://developers.google.com/appengine/docs/java/tools/maven ) but I don't want to use Maven to deploy/use devserver. 我以正式方式( https://developers.google.com/appengine/docs/java/tools/maven )将GAE项目迁移到Maven项目,但我不想使用Maven部署/使用devserver。

When I'm using the GAE Eclipse plugin I get an error: 当我使用GAE Eclipse插件时,出现错误:

Could not locate /path/to/project/target/WEB-INF/appengine-web.xml

Is it possible to use the GAE eclipse plugin or must I use Maven for deploying/local server? 是否可以使用GAE eclipse插件,或者必须使用Maven进行部署/本地服务器?

I found the current process to do this a bit tricky, but it is possible. 我发现当前的过程很难做到这一点,但这可能的。 And it works pretty well after fiddling with it... I've been happy to have Maven manage the dependencies and I've found myself using it to test/deploy too. 轻而易举地就可以很好地工作...我很高兴让Maven管理依赖关系,而且我也发现自己也使用它来测试/部署。 The key to getting it to work can be found in the GWT docs : In particular, you need to use a "dynamic web project" in Eclipse, rather than the normal (to me) GAE project. 使它起作用的关键可以在GWT文档中找到:特别是,您需要在Eclipse中使用“动态Web项目”,而不是普通的(对我而言)GAE项目。

  1. Create the Eclipse Dynamic Web Project as in the link above , including changing the source folders to the proper maven-like location, and changing the web module location to the maven location. 按照上面的链接创建Eclipse Dynamic Web Project,包括将源文件夹更改为适当的类似Maven的位置,以及将Web模块位置更改为该Maven的位置。

  2. Copy your source files in the right places. 将源文件复制到正确的位置。

  3. Add the pom.xml file to the directory. 将pom.xml文件添加到目录中。 At this point, you should be able to go to the command-line and run mvn appengine:devserver 此时,您应该可以转到命令行并运行mvn appengine:devserver

  4. Back in Eclipse, go to the project properties and turn on Google -> App Engine: Use GAE, and use HRD. 返回Eclipse,转到项目属性,然后打开Goog​​le-> App Engine:使用GAE,然后使用HRD。

  5. To be able to use m2eclipse to manage Maven dependencies and take Maven actions in Eclipse, you need to convert the project to a Maven project, as per this StackOverflow question 为了能够使用m2eclipse来管理Maven依赖项并在Eclipse中执行Maven操作,您需要根据此StackOverflow问题将项目转换为Maven项目。

  6. You might need to shutdown Eclipse, rebuild via Maven, restart/refresh Eclipse. 您可能需要关闭Eclipse,通过Maven重建,重新启动/刷新Eclipse。 At this point, you should be able to build/debug/deploy via Eclipse or via Maven! 此时,您应该能够通过Eclipse或Maven进行构建/调试/部署!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM