

Creating Quarkus applications using IntelliJ IDEA
source link: http://www.mastertheboss.com/soa-cloud/quarkus/creating-quarkus-projects-using-intellij-idea/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

This tutorial introduces you to JetBrains IntelliJ Quarkus plugin which lets you bootstrap and develop Quarkus projects in the simplest and most productive way.
Today, there is a wealth of plugins available to develop applications with Quarkus (including Visual Studio, Eclipse, Eclipse Che and IntelliJ Idea). This article focuses on IntelliJ Plugin for Quarkus which has the richest set of options available to develop code and handle configuration.
Installing the Quarkus plugin
Quarkus plugin for IntelliJ IDEA is available both for the Community version of the IDE and the Ultimate Edition. The simplest way to install it, is through the File | Settings | Plugin option, in the top Menu. Search “quarkus” in the plugin list:

Click on “Install” and restart the IDE when done. Now choose to create a New Quarkus Project:

From the Wizard, you will be able to choose the list of extensions for your Project, much the same way you would do when you use the on-line Web application (https://code.quarkus.io):

Finish by setting the project GAV (GroupId, ArtifactId, Version) and the location for your project.
Next, the project will be available in your IDE. As an example, we will find an ExampleResource in it, which is a simple REST Endpoint
package org.acme; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; @Path("/hello") public class ExampleResource { @GET @Produces(MediaType.TEXT_PLAIN) public String hello() { return "hello"; } }
You can run/debug your Quarkus projects from the Terminal or directly from the Idea Tool Bar. To that, you need to add a Quarkus Configuration first. Select the Run -> Edit Configurations… menu and click the Add new... link.
Next, the Run/Debug options will be available in the Top right corner:
Top features in IntelliJ idea plugin
Besides the project bootstrap, there is a wealth of options that are available to speed up your code development and test. Let’s begin from the REST server / client extensions.
REST Services
One of my favourite features is CodeLenses. That works when you are running an application in dev mode. It provides the URL for the GET endpoints.

Besides, when you click on the CodeLens URL will open the URL in your default browser.
Another cool feature, when developing REST Clients, your MicroProfile Rest Client references will be checked against valid injections points. The following picture shows the reference for @RestClient SimpleRESTServiceItf:

Configuration hacks
Firstly, you can use code auto-completion for Quarkus properties:

In addition, if you hover over one of those properties, you will be linked to the documentation for that property.
With regards to user properties, you can simply click on an injection point, for example a ConfigProperty:
…and that will take you to the configuration. This will let you check instantly if the property is available in the configuration:
Also, if you hover on your Property, it will resolve the value for that property in a toolbox:

Maven extensions management
Besides the standard shortcuts you can use on any Maven project, you can also use auto-completion for your extensions in pom.xml. this makes really easy to handle your dependencies from the IDE:

Integration with Qute
If you are using Qute template framework in your project ( Qute: a Template Engine for Quarkus applications ) then, there are a ton of features that you can leverage from IntelliJ Idea.
The one I found extremely useful is that any Template attribute has the option to generate a corresponding Qute template, or navigate to the existing template file.

Within your template, you can declare the Java types at the beginning of it. For instance:
{@org.acme.Foo foo}
Then, you can validate the variables in the template file and leverage code auto-completion:

Alongside support for Java completion and validation, the extension also supports type hovering for built-in and user-defined Java classes. If you want to check the full list of capabilities provided by the Qute server through IntelliJ plugin, then check this post: https://quarkus.io/blog/intellij-quarkus-tools-1.11.0/
Recommend
-
145
Early Access Program Features IntelliJ IDEA 2017.3 Public Preview...
-
12
Monday, June 1, 2015 Highlighting Checkstyle Links using Maven and IntelliJ IDEA Although IntelliJ IDEA has en excellent Maven integration, it doesn not recognize...
-
11
Using the OpenJ9 JVM for Quarkus Applications As defined on the home page, Quarkus is “a Kubernetes Native Java stack tailored for OpenJDK HotSpot and GraalVM”. Since I’m a big fan o...
-
11
Quarkus Tools for IntelliJ 1.3.0 released! By Jeff Maury We are very pleased to announce the...
-
8
Using Quarkus for building reactive Applications When building applications and microservices for container environments like Kubernetes and OpenShift, efficient usage of resources is key. Similarly to popula...
-
5
#java #intelliJIDEA #intelliJIntelliJ IDEA....
-
8
Developing applications with IntelliJ Idea and WildFly 22 October 2021 by F.Marchioni IntelliJ IDEA is a popular choice fo...
-
12
Deploy Quarkus applications to Kubernetes using a Helm chart ...
-
8
Article Deploy Quarkus applications directly to OpenShift using S2I
-
4
有段时间没有更新IDEA了,早上看到 IntelliJ IDEA 2024.1 EAP 5发布的邮件提示,瞄了一眼,发现真的是越来越强了,其中不少功能对我来说还是非常有用的。也许这些能力对关注DD的小伙伴也有帮助,所以搞篇博客介绍和推荐一下。
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK