Converting a Java Eclipse Project to a Google AppEngine Application

I have a project with a lot of preprocessing. I wrote this part and now I would like to convert the project into a GAE project. I have included GAE support in Project-> Properties and have some functionality, but when I want to test the application, I get a "web application archive directory" does not exist.

Is there a way to automatically generate missing folders and files, or do I need to do this manually?

I do not want to copy my classes into a newly created project, as that would mean losing all my version control.

+6
java eclipse google-app-engine
source share
6 answers

I think that with the GAE plugin for Eclipse you can create a GAE application skeleton. You just have to transfer your old project files to this project, and you're done.

For a simple conversion, I don't know if it is possible if the structure of your application is completely different from the GAE structure.

As for your mistake, it seems that your application is missing the WEB-INF directory that any webapp should run.

+1
source share

I use the GAE Eclipse Plugin 1.2.1 and Eclipse 3.4.2, and I have tried the same operation and still have not been successful. I believe that the eclipse plugin is hard-coded to search for various components in specific places. (The correct approach was to configure the GAE plugin to search for all WEB-APP components in places other than the default.) I think that with these versions in mind, it would not be possible to directly convert the eclipse project.

A possible solution, given this limitation, would be to create a new GAE project and copy all your existing code into this structure without changing the folders already created by the GAE plugin.

+1
source share

I don’t know if this will work on Java β†’ GAE project conversion, but I was lucky to do something similar by converting General β†’ Java projects using the following steps:

  • Close your project.
  • Open the project file (which is located in the root directory of the corresponding project) under the name .project with your default editor. Search:

    <natures >
    </natures >

and change it to

  <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> 

Save the modified file.

  1. Open the project again - now it is a java project.

Of course, you will need to create a new GAE project, and then look inside its .project file to get the correct element content. I found that the above steps are going around the world, so I can not, unfortunately, write down the source of the above instructions.

+1
source share

You can convert existing eclipse projects to GAE projects. All you have to do is right-click the project and select the settings. Then select your Google settings and check "Use the Google App Engine SDK."

Using the Google Eclipse Plugin with Existing Projects

+1
source share

Not sure about all the GAE stuff, but you can copy the contents of old projects:

  • Create a new GAE project
  • Close it
  • Use the file manager outside of eclipse to copy all your old projects to a new project. Make sure you include the ".svn" folder, it may not be visible in explorer / nautilus / whatever. You should also consider leaving the .project file only for the new project, as it may contain a specific GAE configuration.
  • Run the project again in Eclipse
  • Right click on the project -> Team -> Share project - Select SVN
  • Your old project URL should already be there, leave the switch with the "Use project settings" setting.

The project connects to the old location of the repository, and in the synchronization view you will see the new files as outgoing.

0
source share

To complete @Marks answer you should add this line to your .project file:

 <nature>com.google.appengine.eclipse.core.gaeNature</nature> 
0
source share

All Articles