Skip to content

Commit ec01eb5

Browse files
authored
update hello world for new gradle & maven plugins (GoogleCloudPlatform#318)
1 parent 70855c7 commit ec01eb5

7 files changed

Lines changed: 373 additions & 18 deletions

File tree

managed_vms/helloworld/README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
1-
# Appengine Helloworld sample for Google App Engine
2-
This sample demonstrates how to deploy an application on Google App Engine
1+
# Appengine Helloworld sample for Google App Engine Flexible
32

4-
## Running locally
5-
$ mvn jetty:run
3+
This sample is used as part of the [Quickstart for Java in the App Engine Flexible Environment](https://cloud.google.com/java/getting-started/hello-world)
64

7-
## Deploying
8-
$ mvn gcloud:deploy
5+
## Setup
6+
7+
Use either:
8+
9+
* `gcloud init`
10+
* `gcloud beta auth application-default login`
11+
12+
## Maven
13+
### Running locally
14+
15+
$ mvn clean jetty:run-exploded
16+
17+
### Deploying
18+
19+
$ mvn appengine:deploy
20+
21+
## Gradle
22+
### Running locally
23+
24+
$ gradle jettyRun
25+
26+
If you do not have gradle installed, you can run using `./gradlew appengineRun`.
27+
28+
### Deploying
29+
30+
$ gradle appengineDeploy
31+
32+
If you do not have gradle installed, you can deploy using `./gradlew appengineDeploy`.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright 2016 Google Inc. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
// [START gradle]
15+
buildscript { // Configuration for building
16+
repositories {
17+
jcenter() // Bintray's repository - a fast Maven Central mirror & more
18+
mavenCentral()
19+
}
20+
dependencies {
21+
classpath 'com.google.cloud.tools:appengine-gradle-plugin:+'
22+
classpath 'org.akhikhl.gretty:gretty:+'
23+
}
24+
}
25+
26+
repositories { // repositories for Jar's you access in your code
27+
jcenter()
28+
mavenCentral()
29+
}
30+
31+
apply plugin: 'java'
32+
apply plugin: 'war'
33+
apply plugin: 'org.akhikhl.gretty'
34+
apply plugin: 'com.google.cloud.tools.appengine'
35+
36+
dependencies {
37+
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
38+
providedCompile 'com.google.appengine:appengine:+'
39+
// Add your dependencies here.
40+
41+
}
42+
43+
// [START gretty]
44+
gretty {
45+
port = 8080
46+
contextPath = '/'
47+
servletContainer = 'jetty9' // What App Engine Flexible uses
48+
}
49+
// [END gretty]
50+
51+
// [START model]
52+
model {
53+
appengine {
54+
55+
deploy { // deploy configuration
56+
stopPreviousVersion = true // default - stop the current version
57+
promote = true // default - & make this the current version
58+
}
59+
60+
}
61+
}
62+
// [END model]
63+
64+
group = 'com.example.appengine' // Generated output GroupId
65+
version = '1.0-SNAPSHOT' // Version in generated output
66+
67+
sourceCompatibility = JavaVersion.VERSION_1_8
68+
targetCompatibility = JavaVersion.VERSION_1_8
69+
// [END gradle]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Aug 31 15:14:13 PDT 2016
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip

managed_vms/helloworld/gradlew

Lines changed: 169 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

managed_vms/helloworld/gradlew.bat

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)