A devfile stack for Open Liberty
The Open Liberty devfile stack provides a consistent way of developing microservices based upon the Jakarta EE and Eclipse MicroProfile specifications. This stack lets you use Maven or Gradle to develop applications for Open Liberty runtime, that is running on OpenJDK with container-optimizations in OpenJ9.
This stack is based on OpenJDK with container-optimizations in OpenJ9 and Open Liberty. It provides live reloading during development by utilizing the "dev mode" capability in the liberty-maven-plugin or liberty-gradle-plugin.
Note: Maven or Gradle is provided by the stack. This allows you to build, test, and debug your Java application without installing those tools locally.
It's recommended to use the latest version of OpenShift Do (odo). You can install odo using these instructions
-
Perform an
oc login
to your cluster. -
Clone the devfile-stack-intro repository
git clone [email protected]:OpenLiberty/devfile-stack-intro.git cd devfile-stack-intro
-
Create your odo component
If you want the application to be built and deployed using Maven:
odo create java-openliberty my-component
If you want the application to be built and deployed using Gradle:
odo create java-openliberty-gradle my-component
-
Push the sample application to OpenShift
odo push
-
Wait for tests to complete
odo log -f
-
Retrieve the URL for your app deployed to OpenShift
odo url list
This URL will show the intro app's welcome page by default.
Click the link: Try your new Microservice "here" to invoke the JAX-RS resource within (or invoke the URL at
<endpoint>/api/resource
to do so directly). -
If you wish to continue and make changes to your local project, you can start odo watch
odo watch
You can now begin developing your app (in another shell or editor)! Changes will be detected and pushed automatically.
To use the starter to create new projects, see: https://github.com/OpenLiberty/devfile-stack/wiki/Using-the-Default-Starter
See: https://github.com/OpenLiberty/devfile-stack/wiki/Migrating-Existing-Maven-Apps-To-Stack
Checkout the devfile-stack wiki for details on using the Open Liberty stack.
follow the guides from the odo.dev site.
Our CONTRIBUTING document contains details for submitting pull requests.
Usage is provided under the Apache 2.0 license. See LICENSE for the full details.