Browse Source

JAVA: Add Maven support for the libphonenumber demo.

That lets the demo be part of the libphonenumber Maven project thus adds the following benefits:
   - Automatically update the version of the demo and the libphonenumber artifact the demo depends on when performing a release.
   - Let Maven handle the deployment of the demo to AppEngine without any need to install the AppEngine SDK.
   - No need to push the dependency JARs (servlet, apache common fileupload/io) even if they are still here to let you use Ant if you prefer.

Note that this CL depends on CL 5395054.

Review URL: http://codereview.appspot.com/5405041
pull/567/head
Philippe Liard 14 years ago
committed by Mihaela Rosca
parent
commit
478492d54b
4 changed files with 123 additions and 2 deletions
  1. +16
    -0
      java/demo/README
  2. +103
    -0
      java/demo/pom.xml
  3. +1
    -0
      java/pom.xml
  4. +3
    -2
      tools/java/data/README

+ 16
- 0
java/demo/README View File

@ -0,0 +1,16 @@
How to install the Appengine SDK to the Maven local repository?
Note that this needs to be done only once.
$ mvn gae:unpack
Note that you don't need to manually download any SDK.
How to generate the WAR?
$ mvn package
$ mvn war:war
Note that this must be done before running the webapp locally and before
deploying it to Appengine.
How to run the webapp locally?
$ mvn gae:run
How to deploy the webapp to Appengine?
$ mvn gae:update

+ 103
- 0
java/demo/pom.xml View File

@ -0,0 +1,103 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>libphonenumber-parent</artifactId>
<groupId>com.googlecode.libphonenumber</groupId>
<version>4.4-SNAPSHOT</version>
</parent>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>demo</artifactId>
<version>4.4-SNAPSHOT</version>
<properties>
<gae.version>1.5.4</gae.version>
</properties>
<repositories>
<repository>
<id>mvnrepository</id>
<url>http://mvnrepository.com/artifact/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>4.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>geocoder</artifactId>
<version>1.8-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>net.kindleit</groupId>
<artifactId>maven-gae-plugin</artifactId>
<version>0.9.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<warSourceDirectory>war</warSourceDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<webAppSourceDirectory>webapp</webAppSourceDirectory>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppConfig>
<contextPath>/</contextPath>
</webAppConfig>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>
</project>

+ 1
- 0
java/pom.xml View File

@ -80,6 +80,7 @@
<modules>
<module>libphonenumber</module>
<module>geocoder</module>
<module>demo</module>
</modules>
<build>


+ 3
- 2
tools/java/data/README View File

@ -4,9 +4,10 @@ Note that this needs to be done only once.
Note that you don't need to manually download any SDK.
How to generate the WAR?
Note that this must be done before running the webapp locally and before
deploying it to Appengine.
$ mvn package
$ mvn war:war
Note that this must be done before running the webapp locally and before
deploying it to Appengine.
How to run the webapp locally?
$ mvn gae:run


Loading…
Cancel
Save