Skip to content

Cloud Tools for Eclipse Product Requirements

Elliotte Rusty Harold edited this page Mar 31, 2017 · 26 revisions

Warning: This project is in the early stages of development. What's described here is where we're going, not where we are today.

Cloud Tools for Eclipse (CT4E) is a plugin that supports development of Java servlet applications on the Google Cloud Platform (GCP) inside the Eclipse Integrated Development Environment (IDE) version 4.5 and later. It enables you to build web applications and sites that run on top of:

  • App Engine Standard
  • App Engine Flex
  • Google Compute Engine (GCE)
  • Google Container Environment (GKE)

Cloud Tools for Eclipse depends on the Eclipse Web Tools Platform (WTP). For the many parts of web app development that do not differ from one servlet container to the next, e.g. unit testing and code completion, you develop using standard WTP tools. CT4E provides additional functionality that's useful specifically for applications hosted on the Google Cloud Platform.

Features include:

  • New application wizards
  • Load existing projects
  • Run your web application on your local workstation for manual testing
  • Debug your web application on your local workstation using the familiar Eclipse debugger
  • Code validations for problems specific to the App Engine standard environment
  • Deploy web applications to the four environments

New application wizards

Create sample applications for all four environments in a few clicks.

  1. File > New > Project...

  2. Expand the Google Cloud Platform folder icon.

  3. Select one of the options. Currently "App Engine Standard Java Project" and "Maven Based App Engine Standard Java Project" are available. TBD: App Engine Flex, Google Compute Engine, and Google Container Engine.

  4. Press the Next button.

  5. Fill out the form to a package. (The remaining defaults are fine for initial local development until you're ready to deploy to the cloud.)

CT4E will create a new Eclipse project, complete with WEB-INF folder, appengine-web.xml file, servlet web.xml file, Java classes, HTML documents, and other minimal boilerplate for a simple Hello World application. A pom.xml is included with the Maven project.

Load existing projects

If your version of Eclipse supports Maven (Eclipse 4.6 Neon or Eclipse 4.5 Mars for JEE), then you can import existing Maven based project into Eclipse:

  1. File > Import

  2. Maven > Existing Projects and click "Next" button.

  3. Browse to the directory that contains the pom.xml for your project and click "Open".

  4. Click Finish.

Other projects can be configured manually. (TBD: how?)

Run your web application on your local workstation for manual testing

When you're ready to try out your new application, select the project in the Eclipse Package Explorer or Project Explorer. From the context menu, select Run As > Run on Server.

Eclipse launches a local server on your workstation that hosts your application. Visit http://localhost:8080/ in any web browser to work with it.

Log messages from the server will appear in the Eclipse console.

To run your application using the App Engine Standard runtime, once you select Run As > App Engine.

Debug your web application on your local workstation using the familiar Eclipse debugger

You can set breakpoints in your Java code as with any other Java application.

If instead of Run As > App Engine you select Debug As > App Engine, then Eclipse will halt execution of the application and open the debugger when the breakpoint is reached.

Code validations for problems specific to the App Engine Standard environment

TBD not yet implemented

If you reference a non-whitelisted class in an application targeted to the App Engine Standard environment, GEP will put a red squiggly line under the reference. (The other environments do not place any limits on which Java classes you may use.)

You can exclude particular classes from this validation (e.g. test classes not actually deployed to the server), either individually or as a group.

Deploy web application

To deploy the application to the Google Cloud Platform:

  1. If you have not already done so, enable the environment you wish to deploy to in the Google Developer Console. (For instance, deploying to GCE requires turning on billing.)

  2. Get a project ID (formerly known as an application ID) from the Developer console.

  3. Select Run > Deploy or from the context menu Deploy

Deploy to App Engine Standard

  1. Get the project ID from the Developer Console.

  2. From the project's context menu, select Deploy to App Engine Standard.

Configuring the App Engine Standard deployment

  1. If you want to change the deployment settings, you can do it by either:

  2. Select Project > Properties > Google > App Engine

  3. Select the Configure Deploy to App Engine Standard... menu item from the project's context menu

  4. The Project > Properties > Google > App Engine settings is available/enabled only if the project has the App Engine Facet.

  5. The App Engine settings tab configures:

  6. Project ID - identifies the App Engine project to use as deploy target for the current project. Overrides the value set in appengine-web.xml.

  7. Version - a fixed version to use for deployment, enabled only if the "Versioning" radio button is set to Manual. Can contain lowercase letters, digits, and hyphens. It cannot begin with the prefix "ah-" and the names "default" and "latest" are reserved and cannot be used. Should begin with a letter.

  8. Versioning - radio button group to choose between Timestamp, appengine-web.xml, or Manual. Defaults to use appengine-web.xml.

  9. Service - name of the service to use for deployment. Defaults to empty string. If empty, the hint should should say "Service name 'default' will be used". Can contain numbers, letters, and hyphens. It cannot be longer than 63 characters and cannot start or end with a hyphen. Overrides the value set in appengine-web.xml.

  10. Always promote - checkbox to enable the promotion of the deployed version to primary, defaults to unchecked.

  11. Bucket - a GCS bucket to use for deployment instead of the default one. Defaults to empty string.

  12. Stop previous version - checkbox to enable stopping the previously running version, defaults to checked.