How to Create your First Spring Framework Application for CloudFoundry.com

Maven

1) Add your account to the Maven settings:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>cloudfoundry.com</id>
      <username><!-- Username --></username>
      <password><!-- Password --></password>
    </server>
  </servers>
</settings>

2) Add the Cloud Foundry Maven Plugin to your project:

<plugin>
  <groupId>org.cloudfoundry</groupId>
  <artifactId>cf-maven-plugin</artifactId>
  <version>1.0.0.M3</version>
  <configuration>
    <server>cloudfoundry.com</server>
    <target>https://api.cloudfoundry.com</target>
    <url>springsample2.cloudfoundry.com</url>
    <memory>256</memory>
  </configuration>
</plugin>

3) Execute the cf:push goal to deploy.

Eclipse

1) Install the Cloud Foundry Integration plugin in Eclipse IDE.

2) Setup your account.

3) Select the “CloudFoundry.com” target.

4) Deploy.

A sample is available here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s