Skip to content

Commit

Permalink
[Endpoints] Fix local development for Guice sample. (#909)
Browse files Browse the repository at this point in the history
* Fix bugs in README and remove manual scaling..

* Fix java7 version of endpoints frameworks guice sample

* Remove welcome file from web.xml

* Adding region tags and cleaning up.
  • Loading branch information
frankyn authored Nov 7, 2017
1 parent c8cc69f commit 30b58e8
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 25 deletions.
2 changes: 1 addition & 1 deletion appengine-java8/endpoints-v2-guice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ To build the project:

To generate the required configuration file `openapi.json`:

mvn endpoints-framework:openApiDoc
mvn endpoints-framework:openApiDocs

### Deploying the sample API to App Engine

Expand Down
4 changes: 4 additions & 0 deletions appengine-java8/endpoints-v2-guice/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ apply plugin: 'com.google.cloud.tools.appengine'

dependencies {
compile 'com.google.endpoints:endpoints-framework:2.0.8'
// [START guice_dependency]
compile 'com.google.endpoints:endpoints-framework-guice:'
// [END guice_dependency]
compile 'com.google.endpoints:endpoints-management-control-appengine:1.0.5'
compile 'com.google.endpoints:endpoints-framework-auth:1.0.5'
}

// [START endpoints_plugin_configuration]
endpointsServer {
// Endpoints Framework Plugin server-side configuration
hostname = "${projectId}.appspot.com"
serviceClasses = ['com.example.echo.Echo']
}
// [END endpoints_plugin_configuration]

appengine { // App Engine tasks configuration
deploy { // deploy configuration
Expand Down
11 changes: 4 additions & 7 deletions appengine-java8/endpoints-v2-guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@
<artifactId>endpoints-framework</artifactId>
<version>${endpoints.framework.version}</version>
</dependency>
<!-- [START guice_dependency] -->
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-framework-guice</artifactId>
<version>2.0.9</version>
</dependency>
<!-- [END guice_dependency] -->
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-management-control-appengine-all</artifactId>
Expand Down Expand Up @@ -102,6 +104,7 @@
<!-- deploy configuration -->
</configuration>
</plugin>
<!-- [START endpoints_plugin] -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>endpoints-framework-maven-plugin</artifactId>
Expand All @@ -113,14 +116,8 @@
<serviceClass>com.example.echo.Echo</serviceClass>
</serviceClasses>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-management-control-appengine-all</artifactId>
<version>1.0.5</version>
</dependency>
</dependencies>
</plugin>
<!-- [START endpoints_plugin] -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.example.echo;

//import com.google.api.server.spi.guice.GuiceServletContextListener;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
<runtime>java8</runtime>
<threadsafe>true</threadsafe>

<basic-scaling>
<max-instances>2</max-instances>
</basic-scaling>

<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<!-- Wrap the backend with Endpoints Frameworks v2. -->
<!-- Route API method requests to the backend using Guice. -->
<!-- [START guice_configuration] -->
<filter>
<filter-name>guiceFilter</filter-name>
<filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
Expand All @@ -35,9 +36,6 @@
<listener>
<listener-class>com.example.echo.EchoGuiceListener</listener-class>
</listener>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- [END guice_configuration] -->

</web-app>
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<threadsafe>true</threadsafe>

<basic-scaling>
<max-instances>2</max-instances>
</basic-scaling>

<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,4 @@
<listener-class>com.example.echo.EchoGuiceListener</listener-class>
</listener>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>

</web-app>

0 comments on commit 30b58e8

Please sign in to comment.