GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-docs-samples/appengine-java8/sparkjava-helloworld at master · classicvalues/java-docs-samples

Expand file tree

/

sparkjava-helloworld

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

sparkjava-helloworld

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src/main
src/main
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline

App Engine SparkJava with Java8

Sample written in SparkJava for use with App Engine Java8 Standard.

See the Google App Engine standard environment documentation for more detailed instructions.

  • Java 8
  • Maven (at least 3.5)
  • Google Cloud SDK (aka gcloud command line tool)

Setup

  • Download and initialize the Cloud SDK
gcloud init
  • Create an App Engine app within the current Google Cloud Project
gcloud app create
  • In the pom.xml, update the App Engine Maven Plugin with your Google Cloud Project Id:
<plugin>
  <groupId>com.google.cloud.tools</groupId>
  <artifactId>appengine-maven-plugin</artifactId>
  <version>2.2.0</version>
  <configuration>
    <projectId>myProjectId</projectId>
    <version>GCLOUD_CONFIG</version>
  </configuration>
</plugin>

Note: GCLOUD_CONFIG is a special version for autogenerating an App Engine version. Change this field to specify a specific version name.

Maven

Running locally

mvn package appengine:run

To use vist: http://localhost:8080/

Deploying

mvn package appengine:deploy

To use vist: https://YOUR-PROJECT-ID.appspot.com

Testing

mvn verify

As you add / modify the source code (src/main/java/...) it's very useful to add unit testing to (src/main/test/...). The following resources are quite useful:

  • Junit4
  • Mockito
  • Truth

For further information, consult the Java App Engine documentation.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.