Tuesday, October 1, 2013

pom.xml for Google App Engine + Spring

I am working on a new project that uses GAE (Google App Engine) and Spring.

I faced a few errors while trying to run the project - all related to incorrect configuration in pom.xml

Some of the problems I faced are:

  • [ERROR] Failed to execute goal net.kindleit:maven-gae-plugin:0.8.0:run (default-cli) on project XYZ: ${gae.home} is not a directory: ${gae.home} is not a directory:[ERROR] Please set the sdkDir configuration in your pom.xml to a valid directory. Make sure you have correctly extracted the app engine sdk.
  • [ERROR] Failed to execute goal net.kindleit:maven-gae-plugin:0.8.0:run (default-cli) on project XYZ: Execution default-cli of goal net.kindleit:maven-gae-plugin:0.8.0:run failed: Plugin net.kindleit:maven-gae-plugin:0.8.0 or one of its dependencies could not be resolved: Could not transfer artifact com.google.appengine:appengine-tools-sdk:jar:1.4.0 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000 -> [Help 1]





 <?xml version="1.0"?>  
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">  
  <modelVersion>4.0.0</modelVersion>  
  <groupId>xx.xx.xx</groupId>  
  <artifactId>XYZ</artifactId>  
  <packaging>war</packaging>  
  <version>0.0.1</version>  
  <name>XYZ Webapp</name>  
  <url>http://maven.apache.org</url>  
       <dependencies>  
      <!-- Spring framework -->  
      <dependency>  
           <groupId>org.springframework</groupId>  
                <artifactId>spring</artifactId>  
                <version>2.5.6</version>  
           </dependency>  
           <dependency>   
                <groupId>org.springframework</groupId>   
                <artifactId>spring-core</artifactId>   
                <version>${spring.version}</version>   
           </dependency>   
           <dependency>   
                <groupId>org.springframework</groupId>   
                <artifactId>spring-context</artifactId>   
                <version>${spring.version}</version>   
           </dependency>   
           <dependency>   
                <groupId>org.springframework</groupId>   
                <artifactId>spring-beans</artifactId>   
                <version>${spring.version}</version>   
           </dependency>   
           <!-- Spring MVC framework -->   
           <dependency>   
                <groupId>org.springframework</groupId>   
                <artifactId>spring-webmvc</artifactId>   
                <version>${spring.version}</version>   
           </dependency>   
           <dependency>   
                <groupId>org.springframework</groupId>   
                <artifactId>spring-web</artifactId>   
                <version>${spring.version}</version>   
           </dependency>   
           <!-- Apache Commons Upload -->   
           <dependency>   
                <groupId>commons-fileupload</groupId>   
                <artifactId>commons-fileupload</artifactId>   
                <version>1.2.2</version>   
           </dependency>   
           <!-- Apache Commons Upload -->   
           <dependency>   
                <groupId>commons-io</groupId>   
                <artifactId>commons-io</artifactId>   
                <version>1.3.2</version>   
           </dependency>   
            <!-- JSTL -->   
           <dependency>   
                <groupId>javax.servlet</groupId>   
                <artifactId>jstl</artifactId>   
                <version>1.1.2</version>   
           </dependency>   
            <dependency>   
                <groupId>taglibs</groupId>   
                <artifactId>standard</artifactId>   
                <version>1.1.2</version>   
           </dependency>  
           <dependency>  
                <groupId>com.google.appengine</groupId>  
                <artifactId>appengine-tools-sdk</artifactId>  
                <version>1.8.0</version>  
           </dependency>  
           <dependency>  
                <groupId>com.google.appengine</groupId>  
                <artifactId>appengine-api-1.0-sdk</artifactId>  
                <version>1.8.0</version>  
           </dependency>  
           <dependency>  
       <groupId>net.kindleit</groupId>  
       <artifactId>gae-runtime</artifactId>  
       <version>${gae}</version>  
       <type>pom</type>  
     </dependency>  
      </dependencies>  
      <build>   
      <finalName>SpringFileUpload</finalName>   
           <plugins>   
                <plugin>   
                     <groupId>org.apache.tomcat.maven</groupId>   
                     <artifactId>tomcat7-maven-plugin</artifactId>   
                     <version>2.1</version>   
                     <configuration>   
                          <url>http://localhost:8080/manager/text</url>   
                          <server>my-tomcat</server>   
                          <path>/SpringFileUpload</path>   
                     </configuration>   
                </plugin>   
                <plugin>   
                     <groupId>org.apache.maven.plugins</groupId>   
                     <artifactId>maven-compiler-plugin</artifactId>   
                     <version>3.0</version>   
                     <configuration>   
                          <source>${jdk.version}</source>   
                          <target>${jdk.version}</target>   
                     </configuration>   
                </plugin>  
                <plugin>  
                     <groupId>net.kindleit</groupId>  
                     <artifactId>maven-gae-plugin</artifactId>  
                     <version>0.8.0</version>  
                     <configuration>  
                          <unpackVersion>1.8.0</unpackVersion>  
                          <gae.home>C:\Users\koushik\.m2\repository\com\google\appengine\appengine-java-sdk\1.8.0\appengine-java-sdk-1.8.0</gae.home>  
                     </configuration>  
                </plugin>  
           </plugins>   
      </build>  
      <profiles>  
        <profile>  
          <id>repositories</id>  
                <repositories>  
                     <repository>  
                          <id>maven-gae-plugin-repo</id>  
                          <name>maven-gae-plugin repository</name>  
                          <url>http://maven-gae-plugin.googlecode.com/svn/repository</url>  
                     </repository>  
                </repositories>  
                <pluginRepositories>  
                     <pluginRepository>  
                          <id>maven-gae-plugin-repo</id>  
                          <name>maven-gae-plugin repository</name>  
                          <url>http://maven-gae-plugin.googlecode.com/svn/repository</url>  
                     </pluginRepository>  
                </pluginRepositories>  
                <properties>  
                     <gae.home>C:\Users\koushik\.m2\repository\com\google\appengine\appengine-java-sdk\1.8.0\appengine-java-sdk-1.8.0</gae.home>  
                </properties>  
        </profile>  
      </profiles>  
      <properties>  
           <spring.version>3.0.5.RELEASE</spring.version>  
           <jdk.version>1.5</jdk.version>  
           <gae.home>C:\Users\koushik\.m2\repository\com\google\appengine\appengine-java-sdk\1.8.0\appengine-java-sdk-1.8.0</gae.home>  
           <gae>1.4.0</gae>  
      </properties>  
 </project>  

No comments:

Post a Comment