最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

使用Vert.x Maven插件快速創(chuàng)建項目的方法

 更新時間:2018年09月12日 10:06:00   作者:isea533  
這篇文章主要介紹了使用Vert.x Maven插件快速創(chuàng)建項目的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

本文介紹了使用Vert.x Maven插件快速創(chuàng)建項目的方法,分享給大家,具體如下:

文檔地址: https://reactiverse.io/vertx-maven-plugin

已有項目添加該插件

在項目 pom.xml 目錄,執(zhí)行下面的命令即可添加:

mvn io.reactiverse:vertx-maven-plugin:1.0.17:setup

執(zhí)行該命令后,在 pom.xml 中會增加下面的配置:

<properties>
 <vertx.version>3.5.3</vertx.version>
 <vertx-maven-plugin.version>1.0.17</vertx-maven-plugin.version>
</properties>
<dependencyManagement>
 <dependencies>
  <dependency>
   <groupId>io.vertx</groupId>
   <artifactId>vertx-stack-depchain</artifactId>
   <version>${vertx.version}</version>
   <type>pom</type>
   <scope>import</scope>
  </dependency>
 </dependencies>
</dependencyManagement>

還有下面的插件:

<plugin>
 <groupId>io.reactiverse</groupId>
 <artifactId>vertx-maven-plugin</artifactId>
 <version>${vertx-maven-plugin.version}</version>
 <executions>
  <execution>
   <id>vmp</id>
   <goals>
    <goal>initialize</goal>
    <goal>package</goal>
   </goals>
  </execution>
 </executions>
 <configuration>
  <redeploy>true</redeploy>
 </configuration>
</plugin>

自動引入的 vert.x 版本為 3.5.3,你可以通過在 mvn 命令增加 -DvertxVersion=3.4.0 這個參數(shù)來指定需要的版本。

從頭創(chuàng)建空項目

首先你 必須創(chuàng)建一個目錄 ,vert.x 插件不會自動給你創(chuàng)建目錄,只會創(chuàng)建目錄內(nèi)的 src 和 pom.xml 等文件。

創(chuàng)建一個目錄,進入該目錄內(nèi),在該目錄內(nèi)執(zhí)行下面的命令:

mvn io.reactiverse:vertx-maven-plugin:1.0.17:setup ^
  -DprojectGroupId=org.acme ^
  -DprojectArtifactId=acme-project ^
  -DprojectVersion=1.0-SNAPSHOT ^
  -Dverticle=org.acme.Foo ^
  -Dverticle=io.vertx.sample.MyFirstVerticle ^
  -Ddependencies=web

如果你使用的 Linux 系統(tǒng),將上面的 ^ 改為 \ 。

這里和上面相比增加了項目 GAV 的配置。

通過 -Dverticle=io.vertx.sample.MyFirstVerticle ,可以生成一個默認的 Verticle 類。

通過 -Ddependencies=web 可以指定你想加入的 vert.x 的依賴,這里寫的名字都是縮寫,具體對應(yīng)關(guān)系看下面的介紹。

使用上面命令后,就創(chuàng)建了一個基礎(chǔ) vert.x 項目,在開始學(xué)習(xí) vert.x 的時候,通過這種方式可以更快的創(chuàng)建基礎(chǔ)項目。

-Ddependencies 對照表

源碼: dependencies.json

下面 JSON 中的 labels 就是縮寫名,groupId 和 artifactId 是對應(yīng)的依賴。

[
  {
    "name": "Vert.x Web",
    "labels": [
      "web"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-web"
  },
  {
    "name": "Vert.x Web Client",
    "labels": [
      "web-client"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-web-client"
  },
  {
    "name": "Vert.x Mongo Client",
    "labels": [
      "mongo"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-mongo-client"
  },
  {
    "name": "Vert.x Kafka Client",
    "labels": [
      "kafka"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-kafka-client"
  },
  {
    "name": "Vert.x Consul Client",
    "labels": [
      "consul"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-consul-client"
  },
  {
    "name": "Vert.x gRPC",
    "labels": [
      "gRPC"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-grpc"
  },
  {
    "name": "Vert.x (async) JDBC Client",
    "labels": [
      "jdbc"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-jdbc-client"
  },
  {
    "name": "Vert.x Redis Client",
    "labels": [
      "redis"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-redis-client"
  },
  {
    "name": "Vert.x Mail Client",
    "labels": [
      "mail",
      "smtp"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-mail-client"
  },
  {
    "name": "Vert.x STOMP",
    "labels": [
      "stomp"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-stomp"
  },
  {
    "name": "Vert.x EventBus Bridge using TCP",
    "labels": [
      "tcp-bridge"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-tcp-eventbus-bridge"
  },
  {
    "name": "Vert.x - Apache Camel bridge",
    "labels": [
      "camel"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-camel-bridge"
  },
  {
    "name": "Vert.x Bridge with AMQP",
    "labels": [
      "amqp"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-amqp-bridge"
  },
  {
    "name": "Vert.x Client for RabbitMQ",
    "labels": [
      "rabbitmq"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-rabbitmq-client"
  },
  {
    "name": "Vert.x Authentication Support using JDBC",
    "labels": [
      "jdbc-auth"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-auth-jdbc"
  },
  {
    "name": "Vert.x Authentication Support using JWT",
    "labels": [
      "jwt-auth"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-auth-jwt"
  },
  {
    "name": "Vert.x Authentication Support using Mongo",
    "labels": [
      "mongo-auth"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-auth-mongo"
  },
  {
    "name": "Vert.x Authentication Support using Shiro",
    "labels": [
      "shiro-auth"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-auth-shiro"
  },
  {
    "name": "Vert.x Authentication Support using OAuth 2",
    "labels": [
      "oauth2",
      "oauth2-auth",
      "oauth"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-auth-oauth2"
  },
  {
    "name": "Vert.x support for RX Java",
    "labels": [
      "rx",
      "rxjava"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-rx-java"
  },
  {
    "name": "Vert.x support for JavaScript (Nashorn)",
    "labels": [
      "js",
      "javascript"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-lang-js"
  },
  {
    "name": "Vert.x support for Kotlin",
    "labels": [
      "kotlin",
      "vertx-kotlin"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-lang-kotlin-compiler"
  },
  {
    "name": "Vert.x support for Ruby (JRuby)",
    "labels": [
      "rb",
      "ruby",
      "jruby"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-lang-ruby"
  },
  {
    "name": "Vert.x support for Apache Groovy",
    "labels": [
      "groovy"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-lang-groovy"
  },
  {
    "name": "Vert.x Service Discovery",
    "labels": [
      "discovery",
      "service-discovery"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-service-discovery"
  },
  {
    "name": "Vert.x Circuit Breaker",
    "labels": [
      "circuit-breaker",
      "circuit"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-circuit-breaker"
  },
  {
    "name": "Vert.x Service Discovery for Kubernetes",
    "labels": [
      "discovery-kubernetes",
      "service-discovery-kubernetes"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-service-discovery-bridge-kubernetes"
  },
  {
    "name": "Vert.x Service Discovery for Consul",
    "labels": [
      "discovery-consul",
      "service-discovery-consul"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-service-discovery-bridge-consul"
  },
  {
    "name": "Vert.x Metrics using Dropwizard",
    "labels": [
      "jmx",
      "dropwizard"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-dropwizard-metrics"
  },
  {
    "name": "Vert.x Metrics using Hawkular",
    "labels": [
      "hawkular"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-hawkular-metrics"
  },
  {
    "name": "Vert.x Shell",
    "labels": [
      "shell"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-shell"
  },
  {
    "name": "Vert.x Unit",
    "labels": [
      "test"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-unit",
    "scope": "test"
  },
  {
    "name": "Vert.x Cluster Manager based on Hazelcast",
    "labels": [
      "hazelcast",
      "hazelcast-cluster-manager"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-hazelcast"
  },
  {
    "name": "Vert.x Cluster Manager based on Infinipan",
    "labels": [
      "infinispan",
      "infinispan-cluster-manager"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-infinispan"
  },
  {
    "name": "Vert.x Cluster Manager based on Zookeeper",
    "labels": [
      "zookeeper-cluster-manager"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-zookeeper"
  },
  {
    "name": "Vert.x Cluster Manager based on Apache Ignite",
    "labels": [
      "ignite"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-ignite"
  },
  {
    "name": "Vert.x Cluster Manager based on Apache Zookeeper",
    "labels": [
      "zookeeper"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-zookeeper"
  },
  {
    "name": "Vert.x Web Template Engine based on Pebble",
    "labels": [
      "pebble",
      "pebble-template",
      "pebble-template-engine"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-web-templ-pebble",
    "classifier": "shaded"
  },
  {
    "name": "Vert.x Web Template Engine based on Apache Freemarker",
    "labels": [
      "freemarker",
      "freemarker-template",
      "freemarker-template-engine"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-web-templ-freemarker",
    "classifier": "shaded"
  },
  {
    "name": "Vert.x Web Template Engine based on Thymeleaf",
    "labels": [
      "thymeleaf",
      "thymeleaf-template",
      "thymeleaf-template-engine"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-web-templ-thymeleaf",
    "classifier": "shaded"
  },
  {
    "name": "Vert.x Web Template Engine based on Handlebars",
    "labels": [
      "handlebars",
      "handlebars-template",
      "handlebars-template-engine"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-web-templ-handlebars",
    "classifier": "shaded"
  },
  {
    "name": "Vert.x Web Template Engine based on Jade",
    "labels": [
      "jade",
      "jade-template",
      "jade-template-engine"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-web-templ-jade",
    "classifier": "shaded"
  },
  {
    "name": "Vert.x Web Template Engine based on MVEL",
    "labels": [
      "mvel",
      "mvel-template",
      "mvel-template-engine"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-web-templ-mvel",
    "classifier": "shaded"
  },
  {
    "name": "Vert.x (async) RPC service proxies",
    "labels": [
      "service-proxies",
      "rpc-services"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-service-proxy"
  },
  {
    "name": "Vert.x Service Factory using Apache Maven",
    "labels": [
      "maven-service-factory"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-maven-service-factory"
  },
  {
    "name": "Vert.x Service Factory",
    "labels": [
      "service-factory"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-service-factory"
  },
  {
    "name": "Vert.x Service Factory using HTTP",
    "labels": [
      "http-service-factory"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-http-service-factory"
  },
  {
    "name": "Vert.x Configuration",
    "labels": [
      "config"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-config"
  },
  {
    "name": "Vert.x Configuration with Kubernetes ConfigMap",
    "labels": [
      "config-kubernetes",
      "config-config-map",
      "config-configmap"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-config-kubernetes-configmap"
  },
  {
    "name": "Vert.x Configuration with a Git repository",
    "labels": [
      "config-git"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-config-git"
  },
  {
    "name": "Vert.x Configuration - HOCON format",
    "labels": [
      "config-hocon"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-config-hocon"
  },
  {
    "name": "Vert.x Configuration - Yaml format",
    "labels": [
      "config-yaml"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-config-yaml"
  },
  {
    "name": "Vert.x Configuration with a Zookeeper backend",
    "labels": [
      "config-zookeeper"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-config-zookeeper"
  },
  {
    "name": "Vert.x Configuration with a Redis backend",
    "labels": [
      "config-redis"
    ],
    "groupId": "io.vertx",
    "artifactId": "vertx-config-redis"
  }
]

打包項目

集成了 vert.x 插件后,打包變的極其容易,只需要下面的命令:

mvn clean package

通過這種方式就會打出一個 fat jar 包,可以直接通過 java -jar xxxx.jar 運行的包。

其他命令

除了上面這些,還有 vertx:run, vertx:debug, vertx:start, vertx:stop 命令,這些命令可以在不打 jar 包的情況下運行或者關(guān)閉項目。

常見問題

通過插件方式運行時,你經(jīng)常會遇到下面的問題:

[INFO] 嚴重: java.net.BindException: Address already in use: bind

這種情況是因為使用類似 IDEA Maven 插件中的命令直接雙擊運行時,你無法關(guān)閉這個應(yīng)用。如果你使用的純命令行,直接 Ctrl+C 就能關(guān)閉。

使用 vertx:run 在命令行運行時可以直接關(guān)閉。

使用 vertx:start 運行時,需要通過 vertx:stop 關(guān)閉。

萬一遇上無法關(guān)閉的情況,在 windows 中,可以用下面方式解決。

在命令行中,輸入下面的命令:

jps -m

這個命令會列出所有運行的 jvm:

15248 Jps -m
2384 Launcher run io.vertx.sample.MyFirstVerticle redeploy-termination-period=1000 -Dvertx.id=5fd656fa-55a9-46b4-8d23-caa95f2e5032-redeploy
8208
11844 Launcher run io.vertx.sample.MyFirstVerticle redeploy-termination-period=1000 -Dvertx.id=bec46d01-d441-4949-a2d9-f8ffbe85f965-redeploy
14200 Launcher run io.vertx.sample.MyFirstVerticle --redeploy=F:\Git\my-first-vertx-app\target\classes/**/* --redeploy-scan-period=1000 redeploy-termi
nation-period=1000 --launcher-class=io.vertx.core.Launcher
7580 Launcher clean compile vertx:run

根據(jù)后面的信息找到你想關(guān)閉的 jvm。輸入下面的命令(假設(shè)關(guān)閉 2384):

taskkill /f /pid 2384

當相同端口的 jvm 關(guān)閉后,你就可以再次運行了。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Java中BorderLayout布局管理器的兩種排列方式

    Java中BorderLayout布局管理器的兩種排列方式

    這篇文章主要介紹了Java中BorderLayout布局管理器的兩種排列方式,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-12-12
  • SpringBoot接口返回的數(shù)據(jù)時間與實際相差8小時問題排查方式

    SpringBoot接口返回的數(shù)據(jù)時間與實際相差8小時問題排查方式

    文章描述了在部署SpringBoot應(yīng)用到容器中時遇到請求接口返回時間與實際相差8小時的問題,并詳細分析了可能的原因及具體的排查步驟和解決方案,總結(jié)指出,環(huán)境初始時區(qū)未配置是根本原因,建議在應(yīng)用部署前配置好時區(qū)
    2025-02-02
  • JavaMail實現(xiàn)郵件發(fā)送機制

    JavaMail實現(xiàn)郵件發(fā)送機制

    這篇文章主要為大家詳細介紹了JavaMail實現(xiàn)郵件發(fā)送機制,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-08-08
  • Spring Cloud Feign原理詳解

    Spring Cloud Feign原理詳解

    Feign 主要是幫助我們方便進行rest api服務(wù)間的調(diào)用,本文從Spring Cloud對feign封裝的源碼中去了解其主要實現(xiàn)機制
    2021-06-06
  • 詳解在Java中如何優(yōu)雅的停止線程

    詳解在Java中如何優(yōu)雅的停止線程

    線程,作為并發(fā)編程的基礎(chǔ)單元,允許程序同時執(zhí)行多個任務(wù),在Java中,線程可以理解為程序中的獨立執(zhí)行路徑,通過使用線程,開發(fā)者可以創(chuàng)建更加響應(yīng)靈敏、效率更高的應(yīng)用程序,本文小編將給大家介紹一下Java中如何優(yōu)雅的停止線程,需要的朋友可以參考下
    2023-11-11
  • java 非常好用的反射框架Reflections介紹

    java 非常好用的反射框架Reflections介紹

    這篇文章主要介紹了java 反射框架Reflections的使用,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2021-04-04
  • SpringCloud 2020-Ribbon負載均衡服務(wù)調(diào)用的實現(xiàn)

    SpringCloud 2020-Ribbon負載均衡服務(wù)調(diào)用的實現(xiàn)

    這篇文章主要介紹了SpringCloud 2020-Ribbon負載均衡服務(wù)調(diào)用的實現(xiàn),本文通過實例代碼給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2021-03-03
  • Springboot整合Gson報錯問題解決過程

    Springboot整合Gson報錯問題解決過程

    這篇文章主要介紹了Springboot整合Gson報錯問題解決過程,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2020-06-06
  • java實現(xiàn)全局監(jiān)聽鍵盤詳解

    java實現(xiàn)全局監(jiān)聽鍵盤詳解

    這篇文章主要為大家詳細介紹了java實現(xiàn)全局監(jiān)聽鍵盤的相關(guān)知識,文中的示例代碼講解詳細,具有一定的學(xué)習(xí)價值,感興趣的小伙伴可以了解下
    2024-01-01
  • java連接mysql數(shù)據(jù)庫詳細步驟解析

    java連接mysql數(shù)據(jù)庫詳細步驟解析

    以下是對java連接mysql數(shù)據(jù)庫的具體詳細步驟進行了分析介紹,需要的朋友可以過來參考下
    2013-08-08

最新評論

西和县| 尚志市| 开封县| 安陆市| 泰州市| 普定县| 武川县| 凤翔县| 汝南县| 依安县| 汉川市| 靖西县| 丹凤县| 鄂托克旗| 蒲江县| 长子县| 永登县| 三门峡市| 顺昌县| 资中县| 连州市| 时尚| 吉木乃县| 龙江县| 青神县| 万全县| 冀州市| 五华县| 揭阳市| 新蔡县| 正镶白旗| 乳山市| 沙湾县| 扶绥县| 肃南| 锦屏县| 志丹县| 长海县| 湖南省| 建德市| 扶风县|