Cloud Foundry Tools for Neon

The Eclipse Tools for Cloud Foundry, also known as "Cloud Foundry Tools", or CFT, is a member of the cloud family at Eclipse, and is now part of Neon, including the Neon JEE EPP package. Cloud Foundry itself is an open platform as a service that provides a choice of clouds, runtime frameworks, and application services.

CFT can be used out of the box to connect to Cloud Foundry and deploy applications with a simple drag and drop operation. It can also be extended by third parties to contribute their own Cloud Foundry flavors, and supports both DEA and newer platforms based on Diego.

We will introduce the project and show how to use this open source tool to deploy and manage Java web applications on Cloud Foundry without leaving the Eclipse IDE.

Prerequisite

CFT is included in Neon JEE EPP package and can be used without any further installations. This article will assume a Neon JEE EPP package as a development platform.

Users also need a Cloud Foundry account to connect to, for example, IBM BlueMix or Pivotal Web Services, as well as a Java web project in their Eclipse workspace.

CFT currently supports deploying Dynamic Web Projects and other war-packaged applications out of the box. Other application types like Node.js and Spring Boot are also supported by third party Eclipse tools that extend CFT, like BlueMix Tools and Spring Tool Suite, respectively. However, these additional application types require further tool installation, and therefore will not be covered in this article.

Creating a Cloud Foundry Server

To deploy an application to Cloud Foundry, a Cloud Foundry server must first be created. This can be done easily by opening the Eclipse Servers view, and either right-clicking to open the context menu, and selecting New → Server, or clicking on the link in the view if no other server exists.

server

This will open the New Server wizard. The Cloud Foundry server type will appear under “Cloud Foundry”, and after selecting it, users have the option to edit the name of the Cloud Foundry server instance that will be created.

new server

Details for the Cloud Foundry server also need to be entered by clicking “Next”. This opens the next page where a server URL needs to be added through “Manage Cloud”, as well as the user’s Cloud Foundry account credentials. Users must have an account with a Cloud Foundry provider prior to continuing.

For example, if connecting to Pivotal Web Services, the server URL would be: http://api.run.pivotal.io

new account

Once account details are entered, users can click “Next” to select a Cloud Foundry organization and space to connect to. When users click “Finish”, the server instance will appear in the Servers view.

Deploying a Java Web Project

Application deployment to Cloud Foundry can be done simply by dragging and dropping a Java web project to the Cloud Foundry server instance in the Servers view.

explorer

An application deployment wizard will then be opened, allowing users to edit default deployment details like the application name, URL, memory, and service bindings.

app details

A new feature in Neon is application URL host-taken detection, which automatically suggests a new name if it detects that a host using the initial application name is already taken, as by default application names are used as hosts. In the screenshot above, the default application name was automatically modified by the wizard to “samplewebapp1”, as the original “samplewebapp” was already used by another application URL.

In addition, this new feature allows URL validation in the next page, for cases where users want to specify a different URL than the one generated by the wizard.

deploy

On the following page, users also have the option to create and bind services to an application.

services selection

Once users click “Finish”, the application deployment will begin, and the Eclipse console will automatically open showing deployment progress and log streaming from Cloud Foundry.

Managing Applications and Services

A deployed application will appear in the Servers view under the Cloud Foundry server instance.

server view

To manage the application, including scaling memory and number of application instances, binding and unbinding services, and restarting and stopping the application, users can double-click on the application in the Servers view. This opens the Cloud Foundry editor for that server instance.

applications and services

Applications can also be restarted, stopped, and deleted using the Servers view context menu.

Open Source Project

CFT is an open source project with a growing community, and is actively maintained and updated by various Eclipse contributors, including Pivotal and IBM.

It is part of the Eclipse release train, and it is aligned with the Eclipse Simultaneous Release schedule.

The CFT code repository is hosted on github, and both the main CFT GitHub page, as well as the Eclipse project page for CFT, contain additional information on release schedules as well as how to contribute code and participate in the CFT development.

CFT releases frequent milestones with bug fixes and new features, and users can find the latest version from both the CFT downloads page as well as the Eclipse Marketplace.

About the Authors

Nieraj Singh

Nieraj Singh
Pivotal

Elson Yuen

Elson Yuen
IBM