Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Cloud Foundry Maven Plugin to Build and Deploy Bluemix Applications

DZone's Guide to

Cloud Foundry Maven Plugin to Build and Deploy Bluemix Applications

Learn more about the Cloud Foundry Maven Plugin, and how it can make it deployment easier by leveraging user-provided services, setting environmental variables, and more.

· Cloud Zone ·
Free Resource

Insight into the right steps to take for migrating workloads to public cloud and successfully reducing cost as a result. Read the Guide.

For some people this is old news, but I just used for the first time the Cloud Foundry Maven Plugin to build and deploy a Bluemix application and it made the deployment really easy. Below are some of the key concepts I used.

I built a Java application that leverages the AlchemyAPI service which at this point requires to go to a separate website and register an API key which is then stored in a user provided service. Additionally I used web sockets and I had to set an environment variable to use this feature on Liberty for Java.

With the Cloud Foundry Maven Plugin I can create user provided services, normal services, set environment variables and much more. The pom.xml screenshot below shows the configuration of the plugin. To use the plugin you simply add it to your pom.xml.


In order to invoke the build and deployment task you can execute the following command and pass in input parameters.


For the actual deployment to Bluemix the plugin requires your Bluemix credentials which are stored in a Settings.xml file in ~/.m2.


Update July 17th: You should use a profile as documented by Ryan below. Here is a sample.

TrueSight Cloud Cost Control provides visibility and control over multi-cloud costs including AWS, Azure, Google Cloud, and others.

Topics:
maven ,cloud foundry ,bluemix ,cloud

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}