Friday, November 7, 2014

Crate Google App-Engine Project in Maven


Start a new project using apache Maven :

APP_ID=<your-app-id>  // e.g. magnetic-clone-xxx
mvn archetype:generate -Dappengine-version=1.9.15 -Dapplication-id=${APP_ID}
  -Dfilter=com.google.appengine.archetypes:

Some additional packages required for app-engine :
Add the dependency to the pom.xml file in the maven project.


  • GCS Client :
     
    <dependency>
    <groupId>com.google.appengine.tools</groupId>
    <artifactId>appengine-gcs-client</artifactId>
    <version>RELEASE</version>
    </dependency>
    
  • Datastore protobuf API :
     
    <dependency>
    <dependency>
     <groupId>com.google.apis</groupId>
     <artifactId>google-api-services-datastore-protobuf</artifactId>
     <version>v1beta2-rev1-2.1.0</version>
    </dependency>
    
  • google-api-client-java6 :
     
    <dependency>
    <dependency>
      <groupId>com.google.api-client</groupId>
      <artifactId>google-api-client-java6</artifactId>
      <version>1.18.0-rc</version>
    </dependency>
    
  • google-oauth-client-jetty :
     
    <dependency>
    <dependency>
     <groupId>com.google.oauth-client</groupId>
     <artifactId>google-oauth-client-jetty</artifactId>
     <version>1.11.0-beta</version>
    </dependency>
    

Maven 3.2.1 - Installation notes

This version is compatible Google app-engine.


sudo apt-get remove maven*
sudo apt-get install gdebi
wget http://ppa.launchpad.net/natecarlson/maven3/ubuntu/pool/main/m/maven3/maven3_3.2.1-0~ppa1_all.deb
sudo gdebi maven3_3.2.1-0~ppa1_all.deb
sudo ln -s /usr/share/maven3/bin/mvn /usr/bin/maven