In this post, I am following up on the post series about Running Eclipse MicroProfile applications in Oracle Cloud by showing how to do it in IBM Cloud Foundry, which includes runtimes for Java, Node.js, ASP.NET Core, PHP, Python, Ruby, Swift and Go.
I am using the same simple application called CloudEE Duke as in the previous posts and will show how to deploy it in the Liberty for Java™ runtime. Since the liberty profile is it is already configured to build using the Liberty Maven Plugin, the only thing you need to do is to activate this profile:
mvn clean package -Pliberty
See the complete pom.xml to see the complete configuration.
Since CloudEE Duke is an Eclipse MicroProfile application, you need to use the packaged server deployment option in order to activate the required features of Liberty. This is done by running the server package command from the Liberty server directory produced by the Liberty Maven Plugin.
target/liberty/wlp/bin/server package defaultServer --include=usr
The server package command produces a .zip file that can be pushed to IBM Cloud with the Cloud Foundry CLI as shown here:
cf push cloudee-duke -p target/liberty/wlp/usr/servers/defaultServer/defaultServer.zip
When your application is deployed, you should be able to access the hello endpoint
Duke says Hello!
As ususal, you will also have the health and metrics endpoints provided by the MicroProfile implementation
checks: [ ]
# TYPE base:classloader_total_loaded_class_count counter
# HELP base:classloader_total_loaded_class_count Displays the total number of classes that have been loaded since the Java virtual machine has started execution.
# TYPE base:gc_global_count counter