Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liberty tools deep dive #2965

Merged
merged 15 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/liberty-tools-eclipse-dash-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/liberty-tools-eclipse-mp-props.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/liberty-tools-eclipse-run-config.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/liberty-tools-eclipse-runas-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/liberty-tools-eclipse-server-config.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 123 additions & 0 deletions posts/2023-03-08-liberty-tools-eclipse-deep-dive.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
---
layout: post
title: "Upgrade your cloud-native Java development experience with Liberty Tools for Eclipse IDE"
categories: blog
author_picture: https://avatars3.githubusercontent.com/awisniew90
author_github: https://github.com/awisniew90
seo-title: Upgrade your cloud-native Java development experience with Liberty Tools for Eclipse IDE
seo-description: Take a deep dive into the features of the latest early release of Liberty Tools for Eclipe IDE
blog_description: "Take a deep dive into the features of the latest early release of Liberty Tools for Eclipe IDE"
open-graph-image: https://openliberty.io/img/blog/liberty-tools-actions.png
---
= Upgrade your cloud-native Java development experience with Liberty Tools for Eclipse IDE
Adam Wisniewski <https://github.com/awisniew90>

Liberty Tools for Eclipse IDE provides a simplified yet powerful development experience. With capabilities like dev mode, Liberty config editing, and Jakarta EE and MicroProfile code assistance, you can code and manage your application without leaving your IDE.

Try it out today by installing from the link:https://marketplace.eclipse.org/content/liberty-tools[Eclipse Marketplace].

Check out the following video for a deep dive walk-through of Liberty Tools for Eclipse IDE:

video::OcgR_4BL12o[youtube, width="560", height="315", align="center"]

Let's dive in!

== What is Liberty Tools?

Liberty Tools is the next generation IDE tooling for developing cloud-native Java applications with Liberty. It takes an app-centric approach, leveraging the capabilities of the Liberty Maven and Liberty Gradle plugins, so you no longer have to spend time creating and managing Liberty instances. By running dev mode behind the scenes, the Liberty runtime is automatically downloaded and started, and your app is built, packaged, and deployed to it. To save even more time, listeners detect any changes you make, and your app is automatically rebuilt and redeployed without having to restart the runtime.

Keeping in line with the app-centric design, Liberty Tools provides code assistance for both Jakarta EE and MicroProfile APIs. Code completion, hover descriptions, diagnostics and quick-fixes save time, reduce errors, and keep you focused on your code. Liberty Tools accomplishes this by integrating with the link:https://github.com/eclipse/lsp4jakarta[Language Server for Jakarta EE] and the link:https://github.com/eclipse/lsp4mp[Language Server for MicroProfile], both open source projects that are continually adding new features and support.

While much of the runtime mechanics are automated with Liberty Tools, some runtime configuration is, of course, necessary. However, this process has been streamlined with config assistance for `server.xml`, `bootstrap.properties`, and `server.env` files. Rather than having to refer to the documentation to find the correct Liberty feature to add or the appropriate value to set for your specific logging attribute, Liberty Tools provides lists of options and descriptions, all without having to leave Eclipse.

Prefer another IDE? Liberty Tools for Eclipse IDE maintains functional parity with plugins for link:https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext[Visual Studio Code] and link:https://plugins.jetbrains.com/plugin/14856-liberty-tools/[Intellij IDEA].

== Requirements

Liberty Tools for Eclipse IDE is designed to work with link:https://github.com/OpenLiberty/liberty-tools-eclipse/blob/main/docs/user-guide.md#software-requirements[supported versions] of both
the IDE for Java EE Developers and the IDE for Java Developers. While Java 17 is needed to run the tool, you can choose a different version of Java to run your application.

Since Liberty Tools uses the Liberty Maven and Liberty Gradle plugins behind the scenes, these plugins must be configured in your application's `pom.xml` or `build.gradle` files. Liberty Tools will also need to run the Maven or Gradle executable which can be accomplished by configuring the Maven and Gradle home in the link:https://github.com/OpenLiberty/liberty-tools-eclipse/blob/main/docs/user-guide.md#setting-preferences[tool's preferences], or including a wrapper with the application.

== Managing your applications

Any application in your Eclipse workspace that contains `src/main/liberty/config/server.xml` is automatically enabled to run with Liberty Tools. Actions are available to manage these apps such as `Start`, `Stop`, `Debug` and `Run Tests`, and you can run these actions from either the Liberty Dashboard or the Eclipse **Run As** menu.

=== Liberty Dashboard

The Liberty Dashboard consolidates the Liberty enabled applications in your workspace into a single view. To open the dashboard, click on the Open Liberty UFO icon on the top tray or press **Alt** + **L**. To run an action, simply right-click on an app in the list.

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-dash-menu.png[Liberty Dashboard,width=70%,align="center"]

=== Eclipse Run As menu

Liberty Tools offers the same set of actions in the Eclipse **Run As** menu that appears when you right click on a project in the Project Explorer view.

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-runas-menu.png[Run As menu,width=70%,align="center"]

=== Starting your app

To start your application in dev mode, select either the **Start** or **Start...** actions. The latter opens a **Run Configurations** dialog box where you can add to the command-line parameters such as link:https://github.com/OpenLiberty/ci.maven/blob/main/docs/dev.md#additional-parameters[additional parameters to dev mode] or configure the JRE to use when running the app. When a start action is selected, Liberty Tools opens a **Terminal** tab and starts dev mode.

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-run-config.gif[Run Configurations,width=70%,align="center"]

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-terminal-start.png[Terminal Start,width=70%,align="center"]

NOTE: The `Start in container` action will link:https://github.com/OpenLiberty/ci.maven/blob/main/docs/dev.md#devc-container-mode[start dev mode in a local Docker container] and requires link:https://github.com/OpenLiberty/liberty-tools-eclipse/blob/main/docs/user-guide.md#docker['docker' on the PATH].

=== Running tests

Tests are important for any application. Liberty Tools makes it easy to run your unit and integration tests by either selecting the `Run tests` action, or simply clicking `Enter` in the terminal. You can even view the results of your latest run by selecting `View test reports`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tests are important for any application. Liberty Tools makes it easy to run your unit and integration tests by either selecting the `Run tests` action, or simply clicking `Enter` in the terminal. You can even view the results of your latest run by selecting `View test reports`.
Tests are important for any application. Liberty Tools makes it easy to run your unit and integration tests by either selecting the **Run tests** action, or simply clicking **Enter** in the terminal. You can even view the results of your latest run by selecting **View test reports**.


=== Debugging your app

By default, the Liberty runtime is configured with port 7777 for debugging. However, this configuration requires that port to be available on your system and for you to manually attach a debugger. With Liberty Tools, you can start your app using the `Debug` action, which finds an available port and automatically attaches the Eclipse debugger to it.

== Get coding!
Liberty Tools provides coding assistance for Jakarta EE and MicroProfile APIs, as well as select Liberty configuration files.

dmuelle marked this conversation as resolved.
Show resolved Hide resolved
=== Jakarta EE

Code completion for Jakarta EE makes it easy to add classes and methods to your app. Just type **CTRL** + **Space** from within any Java file to choose from a list of available code snippets. Additionally, diagnostics flag errors and suggest quick-fixes to implement on the spot.

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-jakarta-snippet-2.gif[Jakarta code completion,width=70%,align="center"]

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-jakarta-quick-fix-2.gif[Jakarta quick fix,width=70%,align="center"]

=== MicroProfile

Similar code completion is available for MicroProfile, as well as type-ahead suggestions and hover descriptions for MicroProfile Config properties. You can easily see what values are set for injected properties directly from your code and get lists of available variables and values to add to your configuration.

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-mp-props-hover.png[MicroProfile config property hover,width=70%,align="center"]

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-mp-props.gif[MicroProfile code completion,width=70%,align="center"]

=== Liberty config editing

Liberty Tools streamlines the process of configuring the Liberty runtime through config completion for `server.xml`, `bootstrap.properties` and `server.env` files. Type **CTRL** + **Space** from within these files to get lists of suggested configuration elements, properties, and values.

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-server-config.gif[Server config code completion,width=70%,align="center"]

[.img_border_light]
image::/img/blog/liberty-tools-eclipse-bootstrap-props.gif[Bootstrap properties code completion,width=70%,align="center"]

== Share your feedback

Like what you see? Need support? Find us on link:https://app.gitter.im/#/room/#OpenLiberty_developer-experience:gitter.im[Gitter], or open an issue or enhancement link:https://github.com/OpenLiberty/liberty-tools-eclipse/issues[on Github].