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

2024-05-15 Developing a new cloud-native Java application with Liberty using Liberty Starter and Liberty Tools within IntelliJ IDEA #3781

Merged
merged 134 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
fccb913
getting-started blog drafted
Ruilin-Ma Feb 9, 2024
3e27295
Merge branch 'ruilin-getting-started-blog' of https://github.com/Open…
Ruilin-Ma Feb 9, 2024
3c907f4
change file name
Ruilin-Ma Feb 9, 2024
b132356
blog content revision
Ruilin-Ma Feb 9, 2024
67f3eda
adjust images & bug fixed
Ruilin-Ma Feb 9, 2024
4c8fce2
blog content revision
Ruilin-Ma Feb 9, 2024
d7d3b01
blog content revision
Ruilin-Ma Feb 9, 2024
b15b345
reformat the heading of the content
Ruilin-Ma Feb 9, 2024
d103fec
adding item to table of content
Ruilin-Ma Feb 9, 2024
bd98a78
content revision
Ruilin-Ma Feb 9, 2024
bdcae29
adjust heading
Ruilin-Ma Feb 9, 2024
612ec10
Enhancing the content flow by introducing the 'Introduction to Libert…
Ruilin-Ma Feb 15, 2024
15dc7f9
Image adjustment & content improvement
Ruilin-Ma Feb 15, 2024
eb3d683
Image adjustment & content improvement
Ruilin-Ma Feb 15, 2024
6f1a45a
content revision
Ruilin-Ma Feb 15, 2024
b3770eb
typo fixed
Ruilin-Ma Feb 15, 2024
e834f26
change the hidden mark
Ruilin-Ma Feb 15, 2024
fbdafd3
addressing suggestion, content revision drafted
Ruilin-Ma Feb 28, 2024
9d1203e
content bug fixed
Ruilin-Ma Feb 28, 2024
f233cf6
replace maven/gradle app with app-name
Ruilin-Ma Feb 28, 2024
6500ac5
content improvement
Ruilin-Ma Feb 28, 2024
70b0756
typo fixed
Ruilin-Ma Feb 28, 2024
cdb4066
content improvement
Ruilin-Ma Feb 28, 2024
574e720
addressing comments
Ruilin-Ma Mar 12, 2024
a08555d
update subtitle for 'trying dev mode'
Ruilin-Ma Mar 12, 2024
fdc44c0
content improvement + comments addressed
Ruilin-Ma Mar 12, 2024
3a36119
rename the liberty getting start blog
Ruilin-Ma Mar 14, 2024
77a63b6
Blog content improvement & addressing comments
Ruilin-Ma Mar 19, 2024
477b63f
content error fixed
Ruilin-Ma Mar 19, 2024
f1035be
content improvement
Ruilin-Ma Mar 21, 2024
784fa71
avoid using utilize
Ruilin-Ma Mar 21, 2024
aec9450
code indentation added
Ruilin-Ma Mar 21, 2024
14715f1
addressing comments from playback meeting
Ruilin-Ma Mar 27, 2024
2cb344e
update LMP and LGP version
Ruilin-Ma Apr 4, 2024
068029d
rephrase liberty project as Liberty Maven or Gradle project
Ruilin-Ma Apr 29, 2024
a1ba44b
rephrase liberty project as Liberty Maven or Gradle project
Ruilin-Ma Apr 29, 2024
7fdc01a
separate post for IntelliJ IDEA
Ruilin-Ma Apr 29, 2024
6474f1d
update images
Ruilin-Ma Apr 29, 2024
77005f5
drafting liberty project starter guide intelij blog revision
Ruilin-Ma May 13, 2024
b13d56c
images update
Ruilin-Ma May 13, 2024
0bdb9b1
image size adjustment
Ruilin-Ma May 13, 2024
30949ba
increase resolution of the liberty tool image
Ruilin-Ma May 13, 2024
8addf40
blog content update
Ruilin-Ma May 13, 2024
e981b8f
content link improvement
Ruilin-Ma May 13, 2024
8f85000
content improvement
Ruilin-Ma May 13, 2024
8e04d91
rearrange the order of displaying project overview
Ruilin-Ma May 14, 2024
e1592dd
typo correction
Ruilin-Ma May 14, 2024
0948006
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
0a35388
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
2dd12f3
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
1f0171c
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
ba34501
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
c779c33
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
84fdecf
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
5192cb5
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
0497b68
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
ea49b4e
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
011233d
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
9a91479
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
1d4b62a
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
8bc3507
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
0a44eee
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
76f1f28
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 15, 2024
0297da6
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
7be3c23
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
6b521de
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
57af9f3
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
1bc4946
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
237303e
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
ac89963
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
f8c1581
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
a418fbd
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
66f7471
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
5051f00
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
00f8f14
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
4f70f6c
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
ae4d320
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
bdc8777
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
59a87d2
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
f84cf87
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
90b6dd8
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
68e7c5b
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
89920b3
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
75aaa1d
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
afc141a
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
0bbf88d
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
6872c1b
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
e36c49e
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
fc9d5d4
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
d251941
fixed subtitle display issue
Ruilin-Ma May 16, 2024
4d682dc
Merge branch 'ruilin-getting-started-blog-Intellij' of https://github…
Ruilin-Ma May 16, 2024
084121e
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 16, 2024
6095010
adding new line before
Ruilin-Ma May 16, 2024
1934133
Merge branch 'ruilin-getting-started-blog-Intellij' of https://github…
Ruilin-Ma May 16, 2024
3af9113
adding suggested changes
Ruilin-Ma May 16, 2024
86d7a9f
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 22, 2024
16c3a86
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 22, 2024
36ad116
change 'package' to 'project'
Ruilin-Ma May 22, 2024
4ad09fc
Merge branch 'ruilin-getting-started-blog-Intellij' of https://github…
Ruilin-Ma May 22, 2024
b00d003
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
8f80780
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
c0a09de
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
6f1e9dc
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
dadc28c
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
707cb24
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
87e1f39
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
e76a6ed
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
29139ed
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
1608aa2
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
ae865d1
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
a054ac5
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
b310111
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
9045a97
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
fc7ef80
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
9b70e6d
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
e5c1f59
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
ca47c22
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
1239597
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
4f65cc5
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
5f191bc
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
ad1d614
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
062e731
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
0df4e0b
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
46d3bd5
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
85b6c83
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
396f813
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
4995787
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
14461fb
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
debf0a3
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
8b53ffc
remove extra space
Ruilin-Ma May 24, 2024
bab2152
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
37da27c
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
df483d0
Update posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Ruilin-Ma May 24, 2024
fac99b8
content improvement
Ruilin-Ma May 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added img/blog/Liberty-Tools-Example.png
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-app-directory-img.png
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-starter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
217 changes: 217 additions & 0 deletions posts/2024-05-05-liberty-project-starter-guide-IntelliJ.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
---
layout: post
title: "Developing a cloud-native Java application with the Liberty Starter, Liberty Tools, and IntelliJ IDEA"
# Do NOT change the categories section
categories: blog
author_picture: https://avatars3.githubusercontent.com/Ruilin-Ma
author_github: https://github.com/Ruilin-Ma
seo-title: Developing a cloud-native Java application with the Liberty Starter, Liberty Tools, and IntelliJ IDEA - OpenLiberty.io
seo-description: Learn how to create a Liberty Maven project for a new cloud-native Java application by using the Open Liberty Starter, and to edit your application using the Liberty Tools in IntelliJ IDEA.
blog_description: Learn how to create a Liberty Maven project for a new cloud-native Java application by using the Open Liberty Starter, and to edit your application using the Liberty Tools in IntelliJ IDEA.
open-graph-image: https://openliberty.io/img/blog/liberty-starter.png
open-graph-image-alt: Open Liberty starter
---
= Developing a cloud-native Java application with Liberty Tools in IntelliJ IDEA
Ruilin Ma <https://github.com/Ruilin-Ma>
:imagesdir: /
:url-prefix:
:url-about: /

:figure-caption!:
//Blank line here is necessary before starting the body of the post.

Learn how to create a Liberty Maven project for a new cloud-native Java application by using the Open Liberty Starter, and to edit your application using the Liberty Tools in IntelliJ IDEA.

* <<prerequisites, Before you start>>
* <<libertyStarter, Create a Liberty Maven project with the Open Liberty Starter>>
* <<ImportProject, Import your project into IntelliJ IDEA>>
* <<AboutProject, Explore your Liberty Maven project>>
* <<libertyToolsWithDevMode, Edit your app using Liberty dev mode>>


[#prerequisites]
== Before you start

=== Installing Java

Install either Java 17 or Java 21. You can link:https://www.ibm.com/support/pages/semeru-runtimes-installation[download IBM Semeru Runtimes for free]. Semeru integrates well with Liberty, but you can find out more about Semeru and other Java distributionslink:https://foojay.io/today/where-do-you-get-your-java/[in this article].





When the Java installation is complete, ensure the `JAVA_HOME` variable is properly configured in your system path. The `JAVA_HOME` variable is essential for Maven Liberty projects because it indicates which JVM to use. Locate the Java installation path on your system, and then export or set the `JAVA_HOME` environment variable using the following command (Linux and Mac):

[role='command']
```
export JAVA_HOME=<your Java installation path>
```

=== Installing Liberty Tools for IntelliJ IDEA
Liberty Tools is a plugin for IntelliJ IDEA that helps you develop, test, debug, and manage Liberty applications in IntelliJ.

To install Liberty Tools in IntelliJ IDEA:

1. Start IntelliJ IDEA.
2. Click **Plugins** or open the **Plugins** section of the **Settings** window.
3. Search the Plugins Marketplace for `Liberty Tools`. If nothing is found, check whether you have a link:https://plugins.jetbrains.com/plugin/14856-liberty-tools[supported version of IntelliJ IDEA].
4. Install Liberty Tools then restart the IDE.

When the IDE restarts, Liberty Tools is installed and enabled.

[#libertyStarter]
== Creating a Liberty Maven project with the Open Liberty Starter

The Open Liberty Starter provides a simple way to create a Liberty Maven project. This Maven project contains all the files and project structure that you need to get started writing your cloud-native Java app. You can easily modify the project configuration in the `pom.xml` and `server.xml` files to add more or different options later, if necessary.

To create your project:

1. Visit the link:https://openliberty.io/start/[Open Liberty Starter].
2. Accept the default values by clicking **Generate Project** and download your project.

image::img/blog/liberty-starter.png[Maven dependencies example,width=60%,align="center"]

[#ImportProject]
== Importing your project into IntelliJ IDEA

When you import a Liberty Maven project into IntelliJ IDEA, Liberty Tools automatically detects the project.

To import your Liberty Maven project:

1. Extract the `app-name.zip` file that you downloaded from the Open Liberty Starter. The file extracts to a project folder called `app-name`, which you can optionally move elsewhere on your file system before you continue.
2. In the IDE, click **File > Open...**, select the project folder, then click **Open**.

Your project is imported into IntelliJ IDEA and detected by Liberty Tools.

[#AboutProject]
== Overview of the Liberty Maven project

=== Project structure

After importing a project into the IDE, the Project view displays the Liberty Maven project structure, as shown in the following image:

image::img/blog/liberty-app-directory-img.png[Liberty Project directory image,width=40%,align="center"]

A well-organized file structure is crucial for Maven projects, providing a clear framework for development. This hierarchy includes directories for application code, MicroProfile and Liberty configuration files, and tests:

- `src/main/java`: Java application code files
- `src/main/liberty/config`: Liberty configuration files
- `src/main/resources/META-INF`: MicroProfile configuration files
- `src/test`: Test files
- `Dockerfile`: Dockerfile for building the Docker image
- `mvnw` or `mvnw.cmd`: Maven Wrapper script for Unix-like or Windows operating systems


In the `app-name` directory, the `pom.xml` file contains configuration details for the project, including dependencies, plugins, and other settings.

=== Declaring dependencies
If you need to add any Liberty features to your app (such as JPA support), update the Maven project configuration in the `pom.xml` file.

To declare dependencies, edit the `<dependencies>` section of the `pom.xml` file, as shown in the following example:

[source, xml]
----
<dependencies>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>10.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
----

In this example, the `jakarta.jakartaee-api` API from the `jakarta.platform` project is introduced as a dependency for this project.

You can add more dependencies to your Maven project from the link:https://mvnrepository.com/open-source/[Maven Library].

=== Adding Maven plugins

In IntelliJ IDEA , like many other development tools, you can enhance the functionality of Maven by adding Maven plugins. Maven plugins are commonly used for compiling code, running tests, and packaging applications.

The Open Liberty Starter configures the Liberty Maven Plugin in your Maven project by default. The Liberty Maven Plugin provides several goals for managing a Liberty runtime, including tasks such as downloading and installing the Liberty runtime, starting or stopping a Liberty server in development mode, installing features, and deploying applications.

You can see where the Liberty Maven Plugin is configured in your Liberty Maven project in the `pluginManagement` section of the `pom.xml`:

[source, xml]
----
<pluginManagement>
<plugins>
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.10.2</version>
</plugin>
</plugins>
</pluginManagement>
----

//explain lmp here
In this example, the `liberty-maven-plugin` from `io.openliberty.tools` is added to this project.

For more information, see the link:https://github.com/OpenLiberty/ci.maven/blob/main/README.md[Liberty Maven Plugin docs].


[#libertyToolsWithDevMode]
== Efficiently edit your application with Liberty dev mode

Liberty Tools enhances the application development experience with Open Liberty by providing convenient features that are integrated directly into your IDE, including the Liberty Dashboard and Liberty dev mode.

The Liberty Dashboard effectively manages Maven projects, seamlessly integrating configurations for Open Liberty. It facilitates rapid development of MicroProfile and Jakarta EE applications by offering automatic code blocks, auto-complete functionality, and real-time syntax validation. With just a few clicks, you can start or stop your app, run tests, and check reports.

Liberty dev mode can swiftly apply code changes to your running app without needing to restart the server, ensuring faster development.

Click the Open Liberty logo in the IDE window to open the Liberty tool window, which provides a set of actions to help you to manage your app (e.g. starting and stopping the Liberty runtime instance):

image::img/blog/Liberty-Tools-Example.png[Liberty Tools Example image, title="An example integrating Liberty Dashboard from Liberty Tools into a Maven project with IntelliJ IDEA", width=30%,align="center"]

Liberty Tools offer three ways to start your Liberty application in dev mode: Start, Start with configuration, or Start in a container.

For now, click the **Start** action to simply start your application in dev mode.






Dev mode automatically detects, recompiles, and deploys code changes whenever you save a new change in your IDE or text editor. The following example creates a simple REST resource Java file.

Ensure that Liberty dev mode is running, then create the following Java class file named `HelloWorldResource.java` as the REST resource:

[source, java]
----
src/main/java/com/demo/rest/HelloWorldResource.java
----

Paste the following code into the file:

[source,java]
```
package com.demo.rest;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/hello")
public class HelloWorldResource {

@GET
@Produces(MediaType.TEXT_PLAIN)
public String helloWorld() {
return "Hello, World!";
}
}
```

When the console displays `Web application available`, the Liberty server has successfully detected, recompiled, and deployed the changes. You can now view the message drafted in the example by accessing the link: http://localhost:9080/app-name/api/hello

For more information, see:

Ruilin-Ma marked this conversation as resolved.
Show resolved Hide resolved
* link:https://openliberty.io/docs/latest/development-mode.html[Open Liberty dev mode docs]
* link:https://developer.ibm.com/articles/awb-effective-cloud-native-development-open-liberty-intellij-idea/[Effective cloud-native Java app development with Open Liberty in IntelliJ IDEA]
* link:https://github.com/OpenLiberty/liberty-tools-intellij/blob/main/docs/user-guide.md#run-your-application-on-liberty-using-dev-mode[Liberty Tools for IntelliJ IDEA user guide]

Ruilin-Ma marked this conversation as resolved.
Show resolved Hide resolved
== Next steps
Learn more about Open Liberty with our link:https://openliberty.io/guides/getting-started.html[Getting started with Open Liberty guide]