Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Migrating from Fabric8 Maven Plugin to Eclipse JKube 1.0.0

September 21, 2020
Rohan Kumar
Related topics:
JavaContainersDeveloper ToolsDevOpsKubernetes

Share:

    The recent release of Eclipse JKube 1.0.0 means that the Fabric8 Maven Plugin is no longer supported. If you are currently using the Fabric8 Maven Plugin, this article provides instructions for migrating to JKube instead. I will also explain the relationship between Eclipse JKube and the Fabric8 Maven Plugin (they're the same thing) and introduce the highlights of the new Eclipse JKube 1.0.0 release. These migration instructions are for developers working on the Kubernetes and Red Hat OpenShift platforms.

    Eclipse JKube is the Fabric8 Maven Plugin

    Eclipse JKube and the Fabric8 Maven Plugin are one and the same. Eclipse JKube was first released in 2014 under the name of Fabric8 Maven Plugin. The development team changed the name when we pre-released Eclipse JKube 0.1.0 in December 2019. For more about the name change, see my recent introduction to Eclipse JKube. This article focuses on the migration path to JKube 1.0.0.

    What's new in Eclipse JKube 1.0.0

    If you are hesitant about migrating to JKube, the following highlights from the new 1.0.0 release might change your mind:

    • Targeted migration with the new Kubernetes Maven Plugin and OpenShift Maven Plugin.
    • Improved base images based on Red Hat Universal Base Images (UBI) and JDK 11. (Fabric8 Maven Plugin's images are based on JDK 8.)
    • No coupling to the fabric8.io platform.
    • Source-to-Image (S2I) support for web applications and Quarkus.
    • Better support for containerizing your applications with JIB integration.
    • Helm support in the Kubernetes Maven Plugin and OpenShift Maven Plugin.
    • Based on JKube Kit, which is independent of both Maven and Gradle.
    • Support for Podman and Buildah is coming soon in Eclipse JKube 1.1.0.

    Fabric8 Maven Plugin generates both Kubernetes and Red Hat OpenShift artifacts, and it automatically detects and deploys resources to the underlying cluster. But developers who use Kubernetes don't need OpenShift artifacts, and OpenShift developers don't need Kubernetes manifests. We addressed this issue by splitting Fabric8 Maven Plugin into two plugins for Eclipse JKube: Kubernetes Maven Plugin and OpenShift Maven Plugin.

    Eclipse JKube migration made easy

    Eclipse JKube has a migrate goal that automatically updates Fabric8 Maven Plugin references in your pom.xml to the Kubernetes Maven Plugin or OpenShift Maven Plugin. In the next sections, I'll show you how to migrate a Fabric8 Maven Plugin-based project to either platform.

    Replace the code for the Fabric8 Maven plugin with either the code for the Kubernetes Maven plugin or the OpenShft Maven plugin.

    For demonstration purposes, we can use my old random generator application, which displays a random JSON response at a /random endpoint. To start, clone this repository:

    $ git clone https://github.com/rohanKanojia/fmp-demo-project.git
    cd fmp-demo-project
    

    Then build the project:

    $ mvn clean install
    

    Eclipse JKube migration for Kubernetes users

    Use the following goal to migrate to Eclipse JKube's Kubernetes Maven Plugin. Note that we have to specify a complete artifactId and groupId because the plugin is not automatically included in the pom.xml:

    $ mvn org.eclipse.jkube:kubernetes-maven-plugin:migrate
    

    Here are the logs for the migrate goal:

    fmp-demo-project : $ mvn org.eclipse.jkube:kubernetes-maven-plugin:migrate
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ----------------------< meetup:random-generator >-----------------------
    [INFO] Building random-generator 0.0.1
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO]
    [INFO] --- kubernetes-maven-plugin:1.0.0-rc-1:migrate (default-cli) @ random-generator ---
    [INFO] k8s: Found Fabric8 Maven Plugin in pom with version 4.4.1
    [INFO] k8s: Renamed src/main/fabric8 to src/main/jkube
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  3.154 s
    [INFO] Finished at: 2020-09-08T19:32:01+05:30
    [INFO] ------------------------------------------------------------------------
    fmp-demo-project : $
    

    You'll notice that all of the Fabric8 Maven Plugin references have been replaced by references to Eclipse JKube. The Kubernetes Maven Plugin is the same as the Fabric8 Maven Plugin. The only differences are the k8s prefix and that it generates Kubernetes manifests.

    Once you've installed the Kubernetes Maven Plugin, you can deploy your application as usual:

    $ mvn k8s:build k8s:resource k8s:deploy
    

    Eclipse JKube migration for OpenShift users

    Use the same migration process for the OpenShift Maven Plugin as you would for the Kubernetes Maven Plugin. Run the migrate goal but with the OpenShift MavenPlugin specified:

    $ mvn org.eclipse.jkube:openshift-maven-plugin:migrate
    

    Here are the logs for this migrate goal:

    fmp-demo-project : $ mvn org.eclipse.jkube:openshift-maven-plugin:migrate
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ----------------------< meetup:random-generator >-----------------------
    [INFO] Building random-generator 0.0.1
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO]
    [INFO] --- openshift-maven-plugin:1.0.0-rc-1:migrate (default-cli) @ random-generator ---
    [INFO] k8s: Found Fabric8 Maven Plugin in pom with version 4.4.1
    [INFO] k8s: Renamed src/main/fabric8 to src/main/jkube
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  4.227 s
    [INFO] Finished at: 2020-09-08T19:41:34+05:30
    [INFO] ------------------------------------------------------------------------
    

    This goal replaces all of your Fabric8 Maven Plugin references with references to OpenShift Maven Plugin. You can then deploy your application to Red Hat OpenShift just as you normally would:

    $ mvn oc:build oc:resource oc:deploy
    

    Conclusion

    See the Eclipse JKube migration guide for more about migrating from the Fabric8 Maven Plugin on OpenShift or Kubernetes. Feel free to create a GitHub issue to report any problems that you encounter during the migration. We really value your feedback, so please report bugs, ask for improvements, and tell us about your migration experience.

    Whether you are already using Eclipse JKube or just curious about it, don't be shy about joining our welcoming community:

    • Provide feedback on GitHub.
    • Craft code and push a pull request to the Eclipse JKube repository.
    • Interact with the Eclipse JKube team on Gitter and the JKube mailing list.
    • Ask questions and get answers on Stack Overflow.
    Last updated: September 17, 2020

    Recent Posts

    • Why Models-as-a-Service architecture is ideal for AI models

    • How to run MicroShift as a container using MINC

    • OpenShift 4.19 brings a unified console for developers and admins

    • 3 steps to secure network segmentation with Ansible and AWS

    • Integrate vLLM inference on macOS/iOS using OpenAI APIs

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue