Browse Source

Update Demo site structure and use official appengine Maven plugin for test run. (#2773)

pull/2787/head
penmetsaa 4 years ago
committed by GitHub
parent
commit
01d5de0acc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 38 additions and 71 deletions
  1. +5
    -20
      java/demo/README
  2. +32
    -50
      java/demo/pom.xml
  3. +0
    -0
      java/demo/src/main/java/com/google/phonenumbers/PhoneNumberParserServlet.java
  4. +0
    -0
      java/demo/src/main/webapp/WEB-INF/appengine-web.xml
  5. +1
    -1
      java/demo/src/main/webapp/WEB-INF/logging.properties
  6. +0
    -0
      java/demo/src/main/webapp/WEB-INF/web.xml
  7. +0
    -0
      java/demo/src/main/webapp/favicon.ico
  8. +0
    -0
      java/demo/src/main/webapp/phonenumberparser.jsp
  9. +0
    -0
      java/demo/src/main/webapp/stylesheets/main.css
  10. BIN
      java/demo/war/WEB-INF/lib/commons-fileupload-1.2.1.jar
  11. BIN
      java/demo/war/WEB-INF/lib/commons-io-1.4.jar
  12. BIN
      java/demo/war/WEB-INF/lib/commons-lang-2.6.jar
  13. BIN
      java/demo/war/WEB-INF/lib/servlet-api-2.5.jar

+ 5
- 20
java/demo/README View File

@ -1,21 +1,6 @@
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.
Prerequisite:
Install the Appengine SDK.
$ sudo apt-get install google-cloud-sdk-app-engine-java
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
If you have made any changes to the code or pom.xml file of demo here,
you may need to run Maven commands like ```mvn clean install -U```
(especially one hierarchy above i.e at java/ folder) to resolve any
dependency issues w.r.t new developement version.
How to regenreate the WAR, deploy and run in appengine?
$ mvn appengine:run

+ 32
- 50
java/demo/pom.xml View File

@ -4,7 +4,7 @@
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>demo</artifactId>
<version>8.12.51-SNAPSHOT</version>
<packaging>jar</packaging>
<packaging>war</packaging>
<url>https://github.com/google/libphonenumber/</url>
<parent>
<groupId>com.googlecode.libphonenumber</groupId>
@ -13,63 +13,32 @@
</parent>
<properties>
<gae.version>1.9.32</gae.version>
<app.deploy.project>libphonenumber-hrd</app.deploy.project>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<archiveClasses>true</archiveClasses>
</properties>
<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.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</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>
<prerequisites>
<maven>3.5</maven>
</prerequisites>
<dependencies>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.96</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@ -103,4 +72,17 @@
</dependency>
</dependencies>
<build>
<!-- for hot reload of the web application-->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
</configuration>
</plugin>
</plugins>
</build>
</project>

java/demo/src/com/google/phonenumbers/PhoneNumberParserServlet.java → java/demo/src/main/java/com/google/phonenumbers/PhoneNumberParserServlet.java View File


java/demo/war/WEB-INF/appengine-web.xml → java/demo/src/main/webapp/WEB-INF/appengine-web.xml View File


java/demo/war/WEB-INF/logging.properties → java/demo/src/main/webapp/WEB-INF/logging.properties View File


java/demo/war/WEB-INF/web.xml → java/demo/src/main/webapp/WEB-INF/web.xml View File


java/demo/war/favicon.ico → java/demo/src/main/webapp/favicon.ico View File


java/demo/war/phonenumberparser.jsp → java/demo/src/main/webapp/phonenumberparser.jsp View File


java/demo/war/stylesheets/main.css → java/demo/src/main/webapp/stylesheets/main.css View File


BIN
java/demo/war/WEB-INF/lib/commons-fileupload-1.2.1.jar View File


BIN
java/demo/war/WEB-INF/lib/commons-io-1.4.jar View File


BIN
java/demo/war/WEB-INF/lib/commons-lang-2.6.jar View File


BIN
java/demo/war/WEB-INF/lib/servlet-api-2.5.jar View File


Loading…
Cancel
Save