To create a new project, you'll need to use an App Engine-provided Maven App
Engine artifact called
appengine-skeleton-archetype, as described in
Creating the project. The App Engine Maven artifact is
what creates the project layout and files required to deploy and run on App
After project creation, you'll need to configure the new project, as described in Configuring the project.
Creating the project
To create the project:
Change to a directory where you want to build your project.
From the command line invoke Maven as follows:
When prompted to Choose a number or apply filter, supply the value
com.google.appengine.archetypes:skeleton-archetypeto display a short list of archetypes matching the filter.
When prompted to Choose a number or apply filter, supply the number displayed for the value
remote -> com.google.appengine.archetypes:appengine-skeleton-archetype, which currently is the number
When prompted to Define value for property 'groupId', supply the value
When prompted to Define value for property 'artifactId', supply the value
When prompted to Define value for property 'version', accept the default value.
When prompted to Define value for property 'package', accept the default value.
When prompted to confirm your choices, accept the default value (Y).
Wait for the project to finish generating. At this point, the basic project layout with required files is complete. Inside the directory where you created the project, you'll have a subdirectory named
guestbook, which contains a
pom.xmlfile and two subdirectories:
guestbook-war, similar to the layout shown here:
We'll describe what to do inside these two subdirectories later. (Notice that the location where you'll add your own Java source code is inside
Now you are ready to configure the project.
Configuring the project
To configure the project:
Change directory to the main application directory (
guestbook), and open
pom.xmlin an editor.
<appengine.target.version>so that it points to the most recent App Engine SDK version, which currently is 1.9.3. Your completed work should look like this:
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <appengine.target.version>1.9.3</appengine.target.version> </properties>
Visit the Google Developers Console in your web browser, and click Create Project.
Supply the project name Guestbook and accept the project ID auto-generated for you. Make a note of the project ID, since you'll need it in the next step, then click Create.
Return to the terminal window for your Maven project, and change directory to
guestbook/guestbook-ear/src/main/application/META-INF/and open the file
appengine-application.xmlin an editor.
Supply the project ID you just obtained above as the value for
Change directory to the main app directory
guestbookand invoke Maven as follows to make sure the project is buildable:
mvn clean install
You should get a success message
[INFO] BUILD SUCCESS.
You are now ready to add your own application code and UI.
Proceed to the next step, Adding Application Code and UI.