Skip to content

OpenLiberty/devfile-stack

Repository files navigation

Spaceship

Open Liberty Logo


License Gitter

Summary

A devfile stack for Open Liberty

Open Liberty Devfile Stack

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.

Getting Started With the Intro Sample

It's recommended to use the latest version of OpenShift Do (odo). You can install odo using these instructions

  1. Perform an oc login to your cluster.

  2. Clone the devfile-stack-intro repository

    git clone git@github.com:OpenLiberty/devfile-stack-intro.git
    cd devfile-stack-intro
  3. 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
  4. Push the sample application to OpenShift

    odo push
  5. Wait for tests to complete

    odo log -f
  6. 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).

  7. 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.

Further Reading

Creating a new stack project

To use the starter to create new projects, see: https://github.com/OpenLiberty/devfile-stack/wiki/Using-the-Default-Starter

Creating a java-openliberty devfile component from an existing project

See: https://github.com/OpenLiberty/devfile-stack/wiki/Migrating-Existing-Maven-Apps-To-Stack

User Doc

Checkout the devfile-stack wiki for details on using the Open Liberty stack.

odo.dev

follow the guides from the odo.dev site.

Contributing

Our CONTRIBUTING document contains details for submitting pull requests.

License

Usage is provided under the Apache 2.0 license. See LICENSE for the full details.