简体   繁体   中英

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.

When I'm using the GAE Eclipse plugin I get an error:

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?

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

  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.

  2. Copy your source files in the right places.

  3. Add the pom.xml file to the directory. At this point, you should be able to go to the command-line and run mvn appengine:devserver

  4. Back in Eclipse, go to the project properties and turn on Google -> App Engine: Use GAE, and use 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

  6. You might need to shutdown Eclipse, rebuild via Maven, restart/refresh Eclipse. At this point, you should be able to build/debug/deploy via Eclipse or via Maven!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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