Skip to content

Commit df3c6ed

Browse files
authored
Use the Java SDK Plugin (GoogleCloudPlatform#479)
1. We want to use the Java SDK plugin for now
1 parent 6efc455 commit df3c6ed

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

appengine/cloudsql/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ Before you can run or deploy the sample, you will need to create a [Cloud SQL in
77
1. Create a new user and database for the application. The easiest way to do this is via the [Google
88
Developers Console](https://console.cloud.google.com/sql/instances). Alternatively, you can use MySQL tools such as the command line client or workbench.
99
2. Change the root password (under Access Control) and / or create a new user / password.
10-
3. Create a Database (under Databases) (or use MySQL with `gcloud sql connect <instance> --user=root`)
10+
3. Create a Database (under Databases) (or use MySQL with `gcloud beta sql connect <instance> --user=root`)
1111
4. Note the **Instance connection name** under Overview > properties
1212
(It will look like project:instance for 1st Generation or project:region:zone for 2nd Generation)
1313

14+
or
15+
16+
```bash
17+
gcloud sql instances describe <instance> | grep connectionName
18+
```
19+
1420
## Deploying
1521

1622
```bash
17-
$ mvn clean appengine:deploy -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root
23+
$ mvn clean appengine:update -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root
1824
-Dpassword=myPassword -Ddatabase=myDatabase
1925
```
2026

@@ -23,7 +29,7 @@ Or you can update the properties in `pom.xml`
2329
## Running locally
2430

2531
```bash
26-
$ mvn clean appengine:run -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root -Dpassword=myPassowrd -Ddatabase=myDatabase
32+
$ mvn clean appengine:devserver -DINSTANCE_CONNECTION_NAME=instanceConnectionName -Duser=root -Dpassword=myPassowrd -Ddatabase=myDatabase
2733
```
2834
Note - you must use a local mysql instance for the 1st Generation instance and change the local Url
2935
in `src/main/webapp/WEB-INF/appengine-web.xml` to use your local server.

appengine/cloudsql/pom.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,16 @@
5858
<dependency>
5959
<groupId>com.google.appengine</groupId>
6060
<artifactId>appengine-api-1.0-sdk</artifactId>
61+
<version>${appengine.sdk.version}</version>
6162
</dependency>
6263

64+
<dependency>
65+
<groupId>com.google.api-client</groupId>
66+
<artifactId>google-api-client-appengine</artifactId>
67+
<version>1.21.0</version>
68+
</dependency>
69+
70+
6371
<!-- [START dependencies] -->
6472
<dependency> <!-- ONLY USED LOCALY -->
6573
<groupId>mysql</groupId>
@@ -93,18 +101,18 @@
93101
</configuration>
94102
</plugin>
95103

104+
<!--
96105
<plugin>
97106
<groupId>com.google.cloud.tools</groupId>
98107
<artifactId>appengine-maven-plugin</artifactId>
99108
<version>${appengine.maven.plugin}</version>
100109
</plugin>
101-
<!--
110+
-->
102111
<plugin>
103112
<groupId>com.google.appengine</groupId>
104113
<artifactId>appengine-maven-plugin</artifactId>
105114
<version>${appengine.sdk.version}</version>
106115
</plugin>
107-
-->
108116
</plugins>
109117
</build>
110118
</project>

0 commit comments

Comments
 (0)