Skip to content

Commit 30b58e8

Browse files
authored
[Endpoints] Fix local development for Guice sample. (GoogleCloudPlatform#909)
* 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.
1 parent c8cc69f commit 30b58e8

File tree

8 files changed

+11
-25
lines changed

8 files changed

+11
-25
lines changed

appengine-java8/endpoints-v2-guice/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ To build the project:
3434

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

37-
mvn endpoints-framework:openApiDoc
37+
mvn endpoints-framework:openApiDocs
3838

3939
### Deploying the sample API to App Engine
4040

appengine-java8/endpoints-v2-guice/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,20 @@ apply plugin: 'com.google.cloud.tools.appengine'
4444

4545
dependencies {
4646
compile 'com.google.endpoints:endpoints-framework:2.0.8'
47+
// [START guice_dependency]
4748
compile 'com.google.endpoints:endpoints-framework-guice:'
49+
// [END guice_dependency]
4850
compile 'com.google.endpoints:endpoints-management-control-appengine:1.0.5'
4951
compile 'com.google.endpoints:endpoints-framework-auth:1.0.5'
5052
}
5153

54+
// [START endpoints_plugin_configuration]
5255
endpointsServer {
5356
// Endpoints Framework Plugin server-side configuration
5457
hostname = "${projectId}.appspot.com"
5558
serviceClasses = ['com.example.echo.Echo']
5659
}
60+
// [END endpoints_plugin_configuration]
5761

5862
appengine { // App Engine tasks configuration
5963
deploy { // deploy configuration

appengine-java8/endpoints-v2-guice/pom.xml

+4-7
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@
4747
<artifactId>endpoints-framework</artifactId>
4848
<version>${endpoints.framework.version}</version>
4949
</dependency>
50+
<!-- [START guice_dependency] -->
5051
<dependency>
5152
<groupId>com.google.endpoints</groupId>
5253
<artifactId>endpoints-framework-guice</artifactId>
5354
<version>2.0.9</version>
5455
</dependency>
56+
<!-- [END guice_dependency] -->
5557
<dependency>
5658
<groupId>com.google.endpoints</groupId>
5759
<artifactId>endpoints-management-control-appengine-all</artifactId>
@@ -102,6 +104,7 @@
102104
<!-- deploy configuration -->
103105
</configuration>
104106
</plugin>
107+
<!-- [START endpoints_plugin] -->
105108
<plugin>
106109
<groupId>com.google.cloud.tools</groupId>
107110
<artifactId>endpoints-framework-maven-plugin</artifactId>
@@ -113,14 +116,8 @@
113116
<serviceClass>com.example.echo.Echo</serviceClass>
114117
</serviceClasses>
115118
</configuration>
116-
<dependencies>
117-
<dependency>
118-
<groupId>com.google.endpoints</groupId>
119-
<artifactId>endpoints-management-control-appengine-all</artifactId>
120-
<version>1.0.5</version>
121-
</dependency>
122-
</dependencies>
123119
</plugin>
120+
<!-- [START endpoints_plugin] -->
124121
<plugin>
125122
<groupId>org.codehaus.mojo</groupId>
126123
<artifactId>versions-maven-plugin</artifactId>

appengine-java8/endpoints-v2-guice/src/main/java/com/example/echo/EchoGuiceListener.java

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.example.echo;
1818

19-
//import com.google.api.server.spi.guice.GuiceServletContextListener;
2019
import com.google.inject.Guice;
2120
import com.google.inject.Injector;
2221
import com.google.inject.servlet.GuiceServletContextListener;

appengine-java8/endpoints-v2-guice/src/main/webapp/WEB-INF/appengine-web.xml

-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
<runtime>java8</runtime>
1919
<threadsafe>true</threadsafe>
2020

21-
<basic-scaling>
22-
<max-instances>2</max-instances>
23-
</basic-scaling>
24-
2521
<system-properties>
2622
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
2723
</system-properties>

appengine-java8/endpoints-v2-guice/src/main/webapp/WEB-INF/web.xml

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
1818
<!-- Wrap the backend with Endpoints Frameworks v2. -->
1919
<!-- Route API method requests to the backend using Guice. -->
20+
<!-- [START guice_configuration] -->
2021
<filter>
2122
<filter-name>guiceFilter</filter-name>
2223
<filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
@@ -35,9 +36,6 @@
3536
<listener>
3637
<listener-class>com.example.echo.EchoGuiceListener</listener-class>
3738
</listener>
38-
39-
<welcome-file-list>
40-
<welcome-file>index.html</welcome-file>
41-
</welcome-file-list>
39+
<!-- [END guice_configuration] -->
4240

4341
</web-app>

appengine/endpoints-frameworks-v2/guice-example/src/main/webapp/WEB-INF/appengine-web.xml

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
1818
<threadsafe>true</threadsafe>
1919

20-
<basic-scaling>
21-
<max-instances>2</max-instances>
22-
</basic-scaling>
23-
2420
<system-properties>
2521
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
2622
</system-properties>

appengine/endpoints-frameworks-v2/guice-example/src/main/webapp/WEB-INF/web.xml

-4
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,4 @@
3636
<listener-class>com.example.echo.EchoGuiceListener</listener-class>
3737
</listener>
3838

39-
<welcome-file-list>
40-
<welcome-file>index.html</welcome-file>
41-
</welcome-file-list>
42-
4339
</web-app>

0 commit comments

Comments
 (0)