quarkus实战之五:细说maven插件

2024-02-19 19:20

本文主要是介绍quarkus实战之五:细说maven插件,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

欢迎访问我的GitHub

这里分类和汇总了欣宸的全部原创(含配套源码):https://github.com/zq2599/blog_demos

本篇概览

  • 本文是《quarkus实战》系列的第五篇,一起去熟悉quarkus的maven插件(就是下图红框中的那个plugin),用好它可以使我们更加得心应手的在项目中配置和控制quarkus

image-20220305180639766

  • 插件quarkus-maven-plugin提供了丰富的功能,它们都有对应的命令,执行mvn quarkus:xxx即可执行,其中xxx就是具体的命令,例如mvn quarkus:help,接下来一起用实际操作来熟悉这些命令

帮助(help)

  • mvn quarkus:help是首先要掌握的命令,它告诉了大家quarkus的maven插件到底有哪些能力,作为工具书,今后随时可能用到,如下所示,篇幅所限,仅列出部分内容:
% mvn quarkus:help
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:help (default-cli) @ hello-quarkus ---
[INFO] Quarkus Platform - Quarkus Maven Plugin 2.7.3.FinalQuarkus Universe platform aggregates extensions from Quarkus Core and thosedeveloped by the community into a single compatible and versioned set thatapplication developers can reference from their applications to align thedependency versionsThis plugin has 25 goals:quarkus:add-extensionAllow adding an extension to an existing pom.xml file. Because you can add oneor several extension in one go, there are 2 mojos: add-extensions andadd-extension. Both supports the extension and extensions parameters.quarkus:add-extensionsAllow adding extensions to an existing pom.xml file. Because you can add oneor several extension in one go, there are 2 mojos: add-extensions andadd-extension. Both supports the extension and extensions parameters.quarkus:analyze-call-treeAnalyze call tree of a method or a class based on an existing report producedby Substrate when using -H:+PrintAnalysisCallTree, and does a more meaningfulanalysis of what is causing a type to be retained.quarkus:buildBuilds the Quarkus application.
...  

创建工程(create)

  • 首先要掌握的mvn命令是创建工程,回顾前文中创建工程的命令:
mvn "io.quarkus:quarkus-maven-plugin:create" \-DprojectGroupId="com.bolingcavalry" \-DprojectArtifactId="hello-quarkus" \-DprojectVersion="1.0-SNAPSHOT" \-DclassName="HobbyResource" \-Dpath="actions"
  • 创建工程时有很多参数可以设置,它们的默认值的作用如下表
参数默认值说明
projectGroupIdorg.acme.samplegroup id,GAV坐标中的G
projectArtifactIdmandatoryartifact id, GAV坐标中的A
projectVersion1.0.0-SNAPSHOTversion, GAV坐标中的V
platformGroupIdio.quarkus.platform在依赖quarkus的BOM,以及quarkus插件时,都要指定GAV,这是G
platformArtifactIdquarkus-bom在依赖quarkus的BOM,以及quarkus插件时,都要指定GAV,这是A
platformVersion2.7.1.Final在依赖quarkus的BOM,以及quarkus插件时,都要指定GAV,这是V,默认值会自动更新到最新稳定版
className无默认值指定后,会自动创建一个类
path无默认值如果指定了className,此时再指定path的话,path会作为类的web接口的path
extensions所需的quarkus插件列表
quarkusRegistryClienttrue是否联网获取最新的quarkus插件列表,如果设置为false,列表只能根据BOM获取,得不到最新的在线数据

查看工程信息(info)

  • 查看工程信息的命令是mvn quarkus:info,使用频率很高,如下,可以观察当前的BOM和扩展插件情况:
(base) willdeMBP:hello-quarkus will$ mvn quarkus:info
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.1.Final:info (default-cli) @ hello-quarkus ---
[WARNING] quarkus:info goal is experimental, its options and output may change in future versions
[INFO] Looking for the newly published extensions in registry.quarkus.io
[INFO] Quarkus platform BOMs:
[INFO]   io.quarkus:quarkus-bom:pom:2.7.1.Final
[INFO] 
[INFO] Extensions from io.quarkus:quarkus-bom:
[INFO]   io.quarkus:quarkus-arc
[INFO]   io.quarkus:quarkus-resteasy
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.828 s
[INFO] Finished at: 2022-03-04T08:40:44+08:00
[INFO] ------------------------------------------------------------------------

paltform列表(list-platforms)

  • 回顾项目的pom.xml文件,如下图,红框中是依赖的平台信息,所有quarkus依赖库都由这个平台统一管理

image-20220305175635703

  • 上图红框中的平台,在quarkus中有多个,我们可以按照自己的实际情况选择,quarkus插件的list-platforms命令可以查看一共有哪些平台类型,完整命令是
mvn quarkus:list-platforms
  • 控制台输出所有平台信息
% mvn quarkus:list-platforms
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:list-platforms (default-cli) @ hello-quarkus ---
[INFO] io.quarkus.platform:quarkus-bom::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-optaplanner-bom::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-kogito-bom::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-qpid-jms-bom::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-cassandra-bom::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-amazon-services-bom::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-camel-bom::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-hazelcast-client::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-debezium-bom::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-blaze-persistence-bom::pom:2.7.3.Final
[INFO] io.quarkus.platform:quarkus-google-cloud-services-bom::pom:2.7.3.Final
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

扩展组件:查看(list-extensions)

  • 扩展组件(extensions)是quarkus的一大特色,web、序列化、数据库等丰富的功能,都有对应的组件提供
  • 命令mvn quarkus:list-extensions可以查看支持的扩展组件列表:
(base) willdeMBP:hello-quarkus will$ mvn quarkus:list-extensions
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.1.Final:list-extensions (default-cli) @ hello-quarkus ---
[INFO] Looking for the newly published extensions in registry.quarkus.io
[INFO] Current Quarkus extensions available: 
[INFO] 
[INFO] ✬ ArtifactId                                         Extension Name
[INFO] ✬ quarkus-agroal                                     Agroal - Database connection pool
[INFO] ✬ quarkus-amazon-lambda                              AWS Lambda
[INFO] ✬ quarkus-amazon-lambda-http                         AWS Lambda HTTP
[INFO] ✬ quarkus-amazon-lambda-rest                         AWS Lambda Gateway REST API
[INFO] ✬ quarkus-amazon-lambda-xray                         AWS Lambda X-Ray
[INFO] ✬ quarkus-apicurio-registry-avro                     Apicurio Registry - Avro
[INFO] ✬ quarkus-avro                                       Apache Avro
[INFO] ✬ quarkus-awt                                        AWT
[INFO] ✬ quarkus-azure-functions-http                       Azure Functions HTTP
[INFO] ✬ quarkus-cache                                      Cache
[INFO] ✬ quarkus-config-yaml                                YAML Configuration
...
  • 如果想看更丰富的信息,可以增加参数-Dformat=full,如下图红框所示,新增了两个字段:
    image-20220305110200957

扩展组件:查看分类(list-categories)

  • 直接用list-extensions命令可以看到所有扩展组件,我们当然不会全部都用,所以最好能有个分类的功能,然后我们在合适的类目中找寻自己需要的组件
  • quarkus已经为我们准备好了分类功能,首先,执行以下命令查看有哪些分类(-Dformat参数可选,有了它会展示更详细的信息)
mvn quarkus:list-categories -Dformat=full
  • 控制台输出如下,列出了所有分类和说明
% mvn quarkus:list-categories -Dformat=full
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:list-categories (default-cli) @ hello-quarkus ---
[INFO] Available Quarkus extension categories: 
[INFO] 
[INFO] Category                       CategoryId           Description
[INFO] Alternative languages          alt-languages        Support for other JVM based languages
[INFO] Alternative languages          alternative-languages Support for other JVM based languages
[INFO] Business Automation            business-automation  Rules engine, BPM, etc
[INFO] Cloud                          cloud                Useful for Cloud Native deployments platforms like Kubernetes and cloud providers
[INFO] Compatibility                  compatibility        Support for alternative programming models on Quarkus
[INFO] Core                           core                 Core Quarkus components: engine, logging, etc.
[INFO] Data                           data                 Accessing and managing your data (RDBMS, NoSQL, caching, transaction management, etc)
[INFO] Integration                    integration          Connectors to read to write from a skew of systems (file, S#, Twitter, etc)
[INFO] Messaging                      messaging            Send and receives message to various messaging systems (AMQP, KAfka etc)
[INFO] Miscellaneous                  miscellaneous        Mixed bag of good stuff
[INFO] Observability                  observability        Metrics, tracing, etc
[INFO] Reactive                       reactive             Non blocking stack and connectors
[INFO] Security                       security             Everything you need to secure your application
[INFO] Serialization                  serialization        Serializing and deserializing various formats
[INFO] Web                            web                  Everything you need for REST endpoints, HTTP and web formats like JSON
[INFO] gRPC                           grpc                 gRPC integration
[INFO] 
[INFO] To list extensions in given category, use:
`./mvnw quarkus:list-extensions -Dcategory="categoryId"`
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
  • 如果我对消息相关的组件感兴趣,可以看messaging这个类目,命令是
mvn quarkus:list-extensions -Dcategory="messaging"
  • 此时控制台会列出messaging这个类目下的所有组件
% mvn quarkus:list-extensions -Dcategory="messaging"              
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:list-extensions (default-cli) @ hello-quarkus ---
[INFO] Current Quarkus extensions available: 
[INFO] 
[INFO] ✬ ArtifactId                                         Extension Name
[INFO]   quarkus-artemis-jms                                Artemis JMS
[INFO] ✬ quarkus-google-cloud-pubsub                        Google Cloud Pubsub
[INFO] ✬ quarkus-kafka-client                               Apache Kafka Client
[INFO] ✬ quarkus-kafka-streams                              Apache Kafka Streams
[INFO] ✬ quarkus-qpid-jms                                   AMQP 1.0 JMS client - Apache Qpid JMS
[INFO]   quarkus-rabbitmq-client                            RabbitMQ Client
[INFO]   quarkus-reactive-messaging-http                    Reactive HTTP and WebSocket Connector
[INFO] ✬ quarkus-smallrye-reactive-messaging                SmallRye Reactive Messaging
[INFO] ✬ quarkus-smallrye-reactive-messaging-amqp           SmallRye Reactive Messaging - AMQP Connector
[INFO] ✬ quarkus-smallrye-reactive-messaging-kafka          SmallRye Reactive Messaging - Kafka Connector
[INFO] ✬ quarkus-smallrye-reactive-messaging-mqtt           SmallRye Reactive Messaging - MQTT Connector
[INFO] ✬ quarkus-smallrye-reactive-messaging-rabbitmq       SmallRye Reactive Messaging - RabbitMQ Connector
[INFO] 
[INFO] To get more information, append `-Dformat=full` to your command line.
[INFO] 
[INFO] Add an extension to your project by adding the dependency to your pom.xml or use `./mvnw quarkus:add-extension -Dextensions="artifactId"`
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

扩展组件:添加(add-extension、add-extensions)

  • mvn quarkus:list-extensions列出所有扩展组件后,可根据实际需要将列出的组件加入自己项目,例如我需要quarkus-jackson这个组件,执行以下命令即可
mvn quarkus:add-extension -Dextensions="quarkus-jackson"
  • 控制台输出如下,提示添加成功
% mvn quarkus:add-extension -Dextensions="quarkus-jackson"
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:add-extension (default-cli) @ hello-quarkus ---
[INFO] [SUCCESS] ✅  Extension io.quarkus:quarkus-jackson has been installed
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.756 s
[INFO] Finished at: 2022-03-05T15:36:40+08:00
[INFO] ------------------------------------------------------------------------
  • 再去看pom.xml,如下图红框,文件已被改动,新增依赖quarkus-jackson

image-20220305160348010

  • 还可以同时添加多个,命令是add-extensions,注意多了个s,多个组件之间用逗号分隔
mvn quarkus:add-extensions -Dextensions="quarkus-jdbc-mysql,quarkus-config-yaml"
  • 为了方便用户,add-extensions除了精确匹配,还会模糊查找,输入下面的命令试试
quarkus:add-extensions -Dextensions="agroal"
  • 控制台输出如下,quarkus-agroal会被找到并添加
% mvn quarkus:add-extensions -Dextensions="agroal"   
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:add-extensions (default-cli) @ hello-quarkus ---
[INFO] [SUCCESS] ✅  Extension io.quarkus:quarkus-agroal has been installed
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.832 s
[INFO] Finished at: 2022-03-05T16:16:53+08:00
[INFO] ------------------------------------------------------------------------
  • 当匹配结果有多个的时候,quarkus插件会提示失败,以jdbc为例,如下所示,有多个匹配结果,因此quarkus插件不知道该选哪个,就报错了:
% mvn quarkus:add-extension -Dextensions="jdbc"   
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:add-extension (default-cli) @ hello-quarkus ---
[INFO] [ERROR] ❗  Multiple extensions matching 'jdbc'- io.quarkus:quarkus-agroal- io.quarkus:quarkus-elytron-security-jdbc- io.quarkus:quarkus-jdbc-db2- io.quarkus:quarkus-jdbc-derby- io.quarkus:quarkus-jdbc-h2- io.quarkus:quarkus-jdbc-mariadb- io.quarkus:quarkus-jdbc-mssql- io.quarkus:quarkus-jdbc-mysql- io.quarkus:quarkus-jdbc-oracle- io.quarkus:quarkus-jdbc-postgresql- org.kie.kogito:kogito-addons-quarkus-persistence-jdbc- org.apache.camel.quarkus:camel-quarkus-jdbcBe more specific e.g using the exact name or the full GAV.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.500 s
[INFO] Finished at: 2022-03-05T16:18:34+08:00
[INFO] ------------------------------------------------------------------------
  • 再用info命令查看当前工程,可以看到刚才添加的组件
[INFO] Quarkus platform BOMs:
[INFO]   io.quarkus.platform:quarkus-bom:pom:2.7.3.Final
[INFO] 
[INFO] Extensions from io.quarkus.platform:quarkus-bom:
[INFO]   io.quarkus:quarkus-jackson
[INFO]   io.quarkus:quarkus-config-yaml
[INFO]   io.quarkus:quarkus-arc
[INFO]   io.quarkus:quarkus-jdbc-mysql
[INFO]   io.quarkus:quarkus-resteasy
[INFO]   io.quarkus:quarkus-agroal
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

扩展组件:删除(remove-extension、remove-extensions)

  • 如果要删除已添加的quarkus组件,例如quarkus-jackson,执行以下命令即可
mvn quarkus:remove-extension -Dextensions="quarkus-jackson"
  • 控制台输入如下,提示删除成功,再去看pom.xml发现quarkus-jackson的依赖也已经被删除了
% mvn quarkus:remove-extension -Dextensions="quarkus-jackson"    
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:remove-extension (default-cli) @ hello-quarkus ---
[INFO] [SUCCESS] ✅  Extension io.quarkus:quarkus-jackson has been uninstalled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
  • 也有批量删除功能,命令是remove-extensions,注意多了个s,多个组件之间用逗号分隔
mvn quarkus:remove-extensions -Dextensions="quarkus-config-yaml,quarkus-jdbc-mysql"
  • 控制台输出
% mvn quarkus:remove-extensions -Dextensions="quarkus-config-yaml,quarkus-jdbc-mysql"
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:remove-extensions (default-cli) @ hello-quarkus ---
[INFO] [SUCCESS] ✅  Extension io.quarkus:quarkus-config-yaml has been uninstalled
[INFO] [SUCCESS] ✅  Extension io.quarkus:quarkus-jdbc-mysql has been uninstalled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
  • 再用info命令查看当前工程,被删除的组件已不在列表
% mvn quarkus:info
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.3.Final:info (default-cli) @ hello-quarkus ---
[WARNING] quarkus:info goal is experimental, its options and output may change in future versions
[INFO] Looking for the newly published extensions in registry.quarkus.io
[INFO] Quarkus platform BOMs:
[INFO]   io.quarkus.platform:quarkus-bom:pom:2.7.3.Final
[INFO] 
[INFO] Extensions from io.quarkus.platform:quarkus-bom:
[INFO]   io.quarkus:quarkus-arc
[INFO]   io.quarkus:quarkus-resteasy
[INFO]   io.quarkus:quarkus-agroal
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

查看依赖树(dependency-tree)

  • 我们常用mvn dependency:tree命令查看maven工程的依赖树,此命令是根据pom.xml的依赖信息分析出所有直接和间接依赖关系,然而,在quarkus应用中存在一些特殊情况:quarkus的maven插件参与了构建,它会根据当前的quarkus扩展组件(extensions)去添加对应的依赖,这是maven本身不知道的,因此,推荐使用mvn quarkus:dependency-tree命令查看quarkus应用的依赖关系:
(base) willdeMBP:hello-quarkus will$ mvn quarkus:dependency-tree
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< com.bolingcavalry:hello-quarkus >-------------------
[INFO] Building hello-quarkus 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:2.7.1.Final:dependency-tree (default-cli) @ hello-quarkus ---
[INFO] Quarkus application PROD mode build dependency tree:
[INFO] com.bolingcavalry:hello-quarkus:pom:1.0-SNAPSHOT
[INFO] ├─ io.quarkus:quarkus-arc-deployment:jar:2.7.1.Final (compile)
[INFO] │  ├─ io.quarkus:quarkus-core-deployment:jar:2.7.1.Final (compile)
[INFO] │  │  ├─ org.aesh:readline:jar:2.2 (compile)
[INFO] │  │  │  └─ org.fusesource.jansi:jansi:jar:1.18 (compile)
[INFO] │  │  ├─ org.aesh:aesh:jar:2.6 (compile)
[INFO] │  │  ├─ org.apache.commons:commons-lang3:jar:3.12.0 (compile)
[INFO] │  │  ├─ org.wildfly.common:wildfly-common:jar:1.5.4.Final-format-001 (compile)
...

离线构建(go-offline)

  • 先回顾一个maven命令mvn dependency:go-offline,其作用是预先下载所有依赖库到本地,这样构建的时候就算没有网络,也能成功构建
  • 但是对于quarkus应用,因为quarkus扩展组件(extensions)不能被maven识别和处理,因此无法分析出这些quarkus扩展组件的依赖库,导致mvn dependency:go-offline命令无法下载这些依赖库
  • 为了解决上述问题,建议使用mvn quarkus:go-offline命令,此命令会分析扩展组件的依赖项,然后下载缓存到本地

更多信息

  • 如果您想了更深入了解quarkus插件的细节,可以参考官方文档:https://quarkus.io/guides/maven-tooling

你不孤单,欣宸原创一路相伴

  1. Java系列
  2. Spring系列
  3. Docker系列
  4. kubernetes系列
  5. 数据库+中间件系列
  6. DevOps系列

这篇关于quarkus实战之五:细说maven插件的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/725684

相关文章

Golang操作DuckDB实战案例分享

《Golang操作DuckDB实战案例分享》DuckDB是一个嵌入式SQL数据库引擎,它与众所周知的SQLite非常相似,但它是为olap风格的工作负载设计的,DuckDB支持各种数据类型和SQL特性... 目录DuckDB的主要优点环境准备初始化表和数据查询单行或多行错误处理和事务完整代码最后总结Duck

关于Maven生命周期相关命令演示

《关于Maven生命周期相关命令演示》Maven的生命周期分为Clean、Default和Site三个主要阶段,每个阶段包含多个关键步骤,如清理、编译、测试、打包等,通过执行相应的Maven命令,可以... 目录1. Maven 生命周期概述1.1 Clean Lifecycle1.2 Default Li

关于Maven中pom.xml文件配置详解

《关于Maven中pom.xml文件配置详解》pom.xml是Maven项目的核心配置文件,它描述了项目的结构、依赖关系、构建配置等信息,通过合理配置pom.xml,可以提高项目的可维护性和构建效率... 目录1. POM文件的基本结构1.1 项目基本信息2. 项目属性2.1 引用属性3. 项目依赖4. 构

Python中的随机森林算法与实战

《Python中的随机森林算法与实战》本文详细介绍了随机森林算法,包括其原理、实现步骤、分类和回归案例,并讨论了其优点和缺点,通过面向对象编程实现了一个简单的随机森林模型,并应用于鸢尾花分类和波士顿房... 目录1、随机森林算法概述2、随机森林的原理3、实现步骤4、分类案例:使用随机森林预测鸢尾花品种4.1

springboot 加载本地jar到maven的实现方法

《springboot加载本地jar到maven的实现方法》如何在SpringBoot项目中加载本地jar到Maven本地仓库,使用Maven的install-file目标来实现,本文结合实例代码给... 在Spring Boothttp://www.chinasem.cn项目中,如果你想要加载一个本地的ja

Golang使用minio替代文件系统的实战教程

《Golang使用minio替代文件系统的实战教程》本文讨论项目开发中直接文件系统的限制或不足,接着介绍Minio对象存储的优势,同时给出Golang的实际示例代码,包括初始化客户端、读取minio对... 目录文件系统 vs Minio文件系统不足:对象存储:miniogolang连接Minio配置Min

Node.js 中 http 模块的深度剖析与实战应用小结

《Node.js中http模块的深度剖析与实战应用小结》本文详细介绍了Node.js中的http模块,从创建HTTP服务器、处理请求与响应,到获取请求参数,每个环节都通过代码示例进行解析,旨在帮... 目录Node.js 中 http 模块的深度剖析与实战应用一、引言二、创建 HTTP 服务器:基石搭建(一

IDEA常用插件之代码扫描SonarLint详解

《IDEA常用插件之代码扫描SonarLint详解》SonarLint是一款用于代码扫描的插件,可以帮助查找隐藏的bug,下载并安装插件后,右键点击项目并选择“Analyze”、“Analyzewit... 目录SonajavascriptrLint 查找隐藏的bug下载安装插件扫描代码查看结果总结Sona

网页解析 lxml 库--实战

lxml库使用流程 lxml 是 Python 的第三方解析库,完全使用 Python 语言编写,它对 XPath表达式提供了良好的支 持,因此能够了高效地解析 HTML/XML 文档。本节讲解如何通过 lxml 库解析 HTML 文档。 pip install lxml lxm| 库提供了一个 etree 模块,该模块专门用来解析 HTML/XML 文档,下面来介绍一下 lxml 库

每天认识几个maven依赖(ActiveMQ+activemq-jaxb+activesoap+activespace+adarwin)

八、ActiveMQ 1、是什么? ActiveMQ 是一个开源的消息中间件(Message Broker),由 Apache 软件基金会开发和维护。它实现了 Java 消息服务(Java Message Service, JMS)规范,并支持多种消息传递协议,包括 AMQP、MQTT 和 OpenWire 等。 2、有什么用? 可靠性:ActiveMQ 提供了消息持久性和事务支持,确保消