quarkus和vertx
This post covers
这篇文章涵盖
- What is Quarkus?什么是Quarkus?
- Getting started with Quarkus Quarkus入门
- What is native executable?什么是本机可执行文件?
Building native executable from Java using Quarkus
使用Quarkus从Java构建本机可执行文件
- Startup time difference for Jar and native executablesJar和本机可执行文件的启动时间差
Hot code replacement for Java (For me this is one of the biggest USP of the framework)
Java的热代码替换(对我来说,这是框架中最大的USP之一)
什么是Quarkus? (What is Quarkus?)
Quarkus is a full-stack, Kubernetes-native Java framework made for Java virtual machines (JVMs) and native compilation, optimizing Java specifically for containers and enabling it to become an effective platform for serverless, cloud, and Kubernetes environments.
Quarkus是针对Java虚拟机(JVM)和本机编译的全栈Kubernetes本地Java框架,专门针对容器优化Java,并使之成为无服务器,云和Kubernetes环境的有效平台。
Quarkus入门 (Getting started with Quarkus)
You would need to have Java 8 or Java 11 installed along with Maven to get started with Quarkus.
您需要与Maven一起安装Java 8或Java 11才能开始使用Quarkus。
创建样板REST项目 (Create a Boilerplate REST project)
Let’s use the Maven plugin to create a boilerplate
让我们使用Maven插件创建样板
mvn io.quarkus:quarkus-maven-plugin:1.8.1.Final:create
Now it would ask for the groupId, artifcatId, version to be entered. It would also ask if we want a REST resource (say yes) followed by the classname and the path of the rest resource. This is how it would look like
现在,它将要求输入groupId,artifcatId,版本。 它还会询问我们是否要使用REST资源(例如“是”),后跟类名和其余资源的路径。 这就是它的样子
Now we have a Quarkus boilerplate project ready to be build and run.
现在我们有一个Quarkus样板项目准备好构建和运行。
建立项目 (Build the project)
To create a Jar run the following command.
要创建一个Jar,请运行以下命令。
mvn package
mvn package