Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions managed_vms/helloworld/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
# Appengine Helloworld sample for Google App Engine
This sample demonstrates how to deploy an application on Google App Engine
# Appengine Helloworld sample for Google App Engine Flexible

## Running locally
$ mvn jetty:run
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)

## Deploying
$ mvn gcloud:deploy
## Setup

Use either:

* `gcloud init`
* `gcloud beta auth application-default login`

## Maven
### Running locally

$ mvn clean jetty:run-exploded

### Deploying

$ mvn appengine:deploy

## Gradle
### Running locally

$ gradle jettyRun

If you do not have gradle installed, you can run using `./gradlew appengineRun`.

### Deploying

$ gradle appengineDeploy

If you do not have gradle installed, you can deploy using `./gradlew appengineDeploy`.
69 changes: 69 additions & 0 deletions managed_vms/helloworld/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// [START gradle]
buildscript { // Configuration for building
repositories {
jcenter() // Bintray's repository - a fast Maven Central mirror & more
mavenCentral()
}
dependencies {
classpath 'com.google.cloud.tools:appengine-gradle-plugin:+'
classpath 'org.akhikhl.gretty:gretty:+'
}
}

repositories { // repositories for Jar's you access in your code
jcenter()
mavenCentral()
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
apply plugin: 'com.google.cloud.tools.appengine'

dependencies {
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
providedCompile 'com.google.appengine:appengine:+'
// Add your dependencies here.

}

// [START gretty]
gretty {
port = 8080
contextPath = '/'
servletContainer = 'jetty9' // What App Engine Flexible uses
}
// [END gretty]

// [START model]
model {
appengine {

deploy { // deploy configuration
stopPreviousVersion = true // default - stop the current version
promote = true // default - & make this the current version
}

}
}
// [END model]

group = 'com.example.appengine' // Generated output GroupId
version = '1.0-SNAPSHOT' // Version in generated output

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
// [END gradle]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Aug 31 15:14:13 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
169 changes: 169 additions & 0 deletions managed_vms/helloworld/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions managed_vms/helloworld/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading