Skip to content
This repository has been archived by the owner. It is now read-only.

deploy into cloudfoundry

hantsy edited this page Jun 25, 2013 · 4 revisions

#Deploy application into CloudFoundry

VMware(the SpringSource's mother company) provides a PAAS cloud service(aka, you can easily deploy your application into via Roo CloudFoundry addon or client tools.

And VMware also provides a Eclipse IDE plugin, with which you can deploy the application into CloudFoundry in IDE, just like deploy into your local server instance.

##Configuration for CloudFoundry

The following steps are based on the project we have created in before post.

  1. Add cloudfoundry dependency in your pom.xml.
  1. Configure a cloud data source in spring configuration file applicationContext.xml.
<beans profile="cloud">
	<cloud:data-source id="dataSource"/>

CloudFoundry also supports other service, such as MongoDb, etc, please consult the cloudfoundry online document for more details.

Register a account

Go to Cloudfoundry , click the Create Account button and follow the steps to register an account.

Homepage in cloud

##Deploy into CloudFoundry via Roo

There is a roo addon in the Roo repository which provides cloudfoundry support.

Execute addon list in the Roo console, you will get the list of current Roo addons.

If you encounter a warning for the license, follow the warning info and type download accept terms of use to accept the terms of use firstly.

Run the following command to search "cloud" keyword in the search results list.

addon search cloud

You can install the addons by id or bundleSymbolicName. Run the following command and install cloudfoundry addon by the specified bundleSymbolicName option.

addon install bundle --bundleSymbolicName 

Now you can use cloudfoundry addon freely as the before existing addons in your local system in Roo console.

Firstly login in,

cloud foundry login --email <email> --password <password>

Create a Cloud ready mysql database service.

 cloud foundry create service --serviceType mysql --serviceName <yourMysqlServiceName>

Deploy your app into,

cloud foundry deploy --appName <yourAppName> --path CREATE

If you do not have a domain for your project, you can specify CREATE value to the path to create a new for your application. Else specify the war path to --path option.

Bind the created MySQL service to your application.

cloud foundry bind service --appName <yourAppName> --serviceName <yourMysqlServiceName>

Start your application,

cloud foundry start app --appName <yourAppName>

You can view the current app list,

cloud foundry list apps

If you see STARTED status of your deployed app, it indicates your application is deployed and running successfully.

Open your browser, go to http://<yourAppName>

Homepage in cloud

##Deploy into CloudFoundry from Eclipse

Firstly make sure you have installed CloudFoundry Eclipse plugin.

If not, you can switch to the Extension tab in the SpringSource Dashboard interface. And find CloudFoundry in the list, click the checkbox before the CloudFoundry item and hint Install button to install it into your IDE.

  1. Create a CloudFoundry server instance.

In the Server view, right click the whitespace and hint the New item in the context menu, and open the New server wizard.

Create a cloudfoudry server instance

Expand VMware node and select CloudFoundry and press Next button.

Create a cloudfoudry server instance

Enter your account info of, click Validate Account to check if the email and password is valid.

Click Finish button, you will see a CloudFoundry instance in the Server view.

  1. Right click the CloudFoundry node in the Server view, select Add and remvoe... in the context menu.

  2. In the popup dialog, select the created project and press Add button.

Create a cloudfoudry server instance

  1. Fill the application details.

Fill the application details

  1. Fill the launch deployment info.

Fill the launch deployment info

  1. In the next step, you can select the service you want to be bound to this application. You can also create a new service by click the New icon here.

Service selection

  1. Click Finish button to complete the steps.

You will see a new application node under the CloudFoundry server instance.

Service selection

If it is stopped, try to start it by clicking the Start in the context menu. You can also perform a Full publish to deploy a fresh application into CloudFoundry.

Navigate to the application home page.


CloudFoundry also provides official client command tools for deploy your application into Please go to the to get more info about this topic.

NOTE: provides a VMWare image for developers in development stage, but your CPU must support Intel-VT(Unlucky, due to lack of Intel-VT support, it does not work on my laptop). you can deploy your project into the local VMWare server instead of the remote service.

You can’t perform that action at this time.