How to start developing Google App Engine applications



To start developing Google App Engine applications you will need:



Run command to generate GAE project using Maven

$ mvn archetype:generate -Dappengine-version=1.9.22 -Dapplication-id=your-app-id -Dfilter=com.google.appengine.archetypes:

Then select :
1: remote -> com.google.appengine.archetypes:appengine-skeleton-archetype (A skeleton application with Google App Engine)

Then use lastest available archetype version:
Choose com.google.appengine.archetypes:appengine-skeleton-archetype version: 
1: 1.8.7
2: 2.0.0-1.9.10
3: 2.0.1-1.9.20
4: 2.0.2-1.9.21

$ mvn archetype:generate -Dappengine-version=1.9.22 -Dapplication-id=guestbook -Dfilter=com.google.appengine.archetypes:
[INFO] Scanning for projects...
[INFO]                                                                       
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: remote -> com.google.appengine.archetypes:appengine-skeleton-archetype (A skeleton application with Google App Engine)
2: remote -> com.google.appengine.archetypes:endpoints-skeleton-archetype (A skeleton project using Cloud Endpoints with Google App Engine Java)
3: remote -> com.google.appengine.archetypes:guestbook-archetype (A guestbook application with Google App Engine)
4: remote -> com.google.appengine.archetypes:hello-endpoints-archetype (A simple starter application using Cloud Endpoints with Google App Engine Java)
5: remote -> com.google.appengine.archetypes:skeleton-archetype (-)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Choose com.google.appengine.archetypes:appengine-skeleton-archetype version:
1: 1.8.7
2: 2.0.0-1.9.10
Choose a number: 2: 2
Define value for property 'groupId': : com.guestbook
Define value for property 'artifactId': : guestbook
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  com.guestbook: :
[INFO] Using property: appengine-version = 1.9.15
[INFO] Using property: application-id = guestbook
Confirm properties configuration:
groupId: com.guestbook
artifactId: guestbook
version: 1.0-SNAPSHOT
package: com.guestbook
appengine-version: 1.9.22
application-id: guestbook
Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: appengine-skeleton-archetype:2.0.0-1.9.21
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.guestbook
[INFO] Parameter: artifactId, Value: guestbook
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.guestbook
[INFO] Parameter: packageInPathFormat, Value: com/guestbook
[INFO] Parameter: package, Value: com.guestbook
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: com.guestbook
[INFO] Parameter: appengine-version, Value: 1.9.22
[INFO] Parameter: application-id, Value: guestbook
[INFO] Parameter: artifactId, Value: guestbook
[INFO] project created from Archetype in dir: /home/gae/Desktop/MavenTest/guestbook
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:58 min
[INFO] Finished at: 2014-12-02T23:54:07+01:00
[INFO] Final Memory: 11M/27M
[INFO] ------------------------------------------------------------------------

Logging

Please set logging level to INFO in WEB-INF/logging.properties:

com.test.guestbook.level = INFO

Test your setup

To test your project build and run dev server

$ mvn clean install

$ mvn appengine:devserver

NOTICE: If you run mvn appengine:devserver on Windows machine Ctrl+C will leave process in background - so please make sure you will kill it to avoid binding DEVSERVER to the same port twice or more.

Now you can import your project to Eclipse or IntelliJ IDEA as Maven project


 

Create GoogleAppEngine application and upload your code  

Go to http://appengine.google.com and create new application.
Go to http://appengine.google.com and click "Create Application"

Modify WEB-INF/appengine-web.xml so that value in <application> matches name of application created and <version> should be set to any integer value you may need.
Adjust <application> and <version> properly
Now you're ready to deploy your application either by running maven command
$ mvn appengine:update

or using Eclipse WTP plugin or IntelliJ IDEA Ultimate GoogleAppEngine plugin

Deploying using Eclipse WTP plugin

Komentarze

Popularne posty z tego bloga

How to deploy Ruby on Rails application on Google Compute Engine

How to Develop Full Stack Spring Boot Application on Google App Engine + Cloud SQL - Step by Step Guide