CLOVERšŸ€

That was when it all began.

Vert.x API Generationć‚’ć”ć‚‡ć£ćØčŖæć¹ć¤ć¤ć€Vert.x恮Redis Client悒SmallRye Mutiny恫åƾåæœć•ć›ć¦ćæ悋

恓悌ćÆ态ćŖć«ć‚’ć—ćŸćć¦ę›øć„ćŸć‚‚ć®ļ¼Ÿ

Quarkus恫ćÆ态SmallRye Mutiny恫åƾåæœć—ćŸReactivećŖSQLć‚Æćƒ©ć‚¤ć‚¢ćƒ³ćƒˆć‚„Redisć‚Æćƒ©ć‚¤ć‚¢ćƒ³ćƒˆćŖć©ćŒć‚ć‚Šć¾ć™ć€‚

Quarkus - Reactive SQL Clients

Quarkus - Using the Redis Client

恓悌悉ćÆ态Vert.xć®ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć‚’å…ƒć«ć—ć¦ć„ć‚‹ć‚‚ć®ć§ć™ćŒć€Vert.xč‡Ŗ体ćÆSmallRye Mutiny恫ćÆåƾåæœć—ć¦ć„ć¾ć›ć‚“ć€‚

ć“ć®ć‚ćŸć‚Šć®ć‹ć‚‰ćć‚Šć‚’ć€ę™‚ć€…čŖæć¹ć¦ćÆåæ˜ć‚Œć¦ć—ć¾ć†ć®ć§ćƒ”ćƒ¢ć—ć¦ćŠć“ć†ć‹ćŖ态ćØ怂

恂ćØ态恓恓恧ē“¹ä»‹ć™ć‚‹Vert.x API Genrator悒ä½æć£ć¦ć€Redisć‚’é”Œęć«Vert.x恮Redisć‚Æćƒ©ć‚¤ć‚¢ćƒ³ćƒˆć‚’SmallRye Mutiny恫åƾåæœć•ć›ć¦
ćæć¾ć—ć‚‡ć†ć€‚

恋悉恏悊ļ¼Ÿ

Quarkus恮Redis ExtensionćÆ态smallrye-mutiny-vertx-redis-clientćØć„ć†ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć«ä¾å­˜ć—ć¦ć„ć¾ć™ć€‚

https://github.com/quarkusio/quarkus/blob/1.9.2.Final/extensions/redis-client/runtime/pom.xml#L23-L26

https://github.com/quarkusio/quarkus/blob/1.9.2.Final/bom/application/pom.xml#L135

smallrye-mutiny-vertx-redis-clientćØć„ć†ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖćÆ态恓恔悉恮ćƒŖ惝ć‚ø惈ćƒŖć«å«ć¾ć‚Œć¦ć„ć¾ć™ć€‚

GitHub - smallrye/smallrye-reactive-utils

恧态ćƒŖ惝ć‚ø惈ćƒŖ悒見悋ćØę°—ć„ćć®ć§ć™ćŒć€ć“ć®ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖ恫ćÆsrc/main/javaćŒć‚ć‚Šć¾ć›ć‚“ć€‚ćƒ†ć‚¹ćƒˆć‚³ćƒ¼ćƒ‰ćÆ
ć‚ć‚‹ć®ć§ć™ćŒć€‚

https://github.com/smallrye/smallrye-reactive-utils/tree/1.2.2/vertx-mutiny-clients/vertx-mutiny-redis-client

恝悂恝悂态Vert.x恮Redisć‚Æćƒ©ć‚¤ć‚¢ćƒ³ćƒˆć®ćƒ‰ć‚­ćƒ„ćƒ”ćƒ³ćƒˆć‚’č¦‹ć¦ć‚‚Reactive StreamsćŖAPI恌ä½æćˆć‚‹é›°å›²ę°—ćÆę„Ÿć˜ć¾ć›ć‚“ć€‚

Vert.x-redis - Vert.x

ć•ć¦ć€ć“ć‚ŒćÆ恩恆恄恆恓ćØ恧恗悇恆ļ¼ŸćØć„ć†ć®ćŒć€ä»Šå›žć®ćŠé”Œć§ć™ć€‚

Vert.x API Generation

smallrye-mutiny-vertx-redis-client恮pom.xml悒見恦恄悋ćØć€ć©ć†ć‚‚ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’č‡Ŗ動ē”Ÿęˆć—ć¦ć„ćć†ćŖé›°å›²ę°—ćŒć‚ć‚Šć¾ć™ć€‚

https://github.com/smallrye/smallrye-reactive-utils/blob/1.2.2/vertx-mutiny-clients/vertx-mutiny-redis-client/pom.xml

ē‰¹ć«ć“ć®ć‚ćŸć‚Šć§ć™ć­ć€‚

            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>4.2-jdk8</version>
                <configuration>
                    <systemProperties>
                        <java.util.logging.SimpleFormatter.format>%4$s: %3$s - %5$s %6$s%n
                        </java.util.logging.SimpleFormatter.format>
                        <mvel2.disable.jit>true</mvel2.disable.jit>
                    </systemProperties>
                </configuration>
                <executions>
                    <!-- Run the annotation processor on java sources and generate the API -->
                    <execution>
                        <id>generate-api</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceDirectory>${project.build.directory}/sources/java</sourceDirectory>
                            <processors>
                                <processor>io.vertx.codegen.CodeGenProcessor</processor>
                            </processors>
                            <optionMap>
                                <codegen.generators>mutiny</codegen.generators>
                            </optionMap>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

ć“ć“ć§å‹•ć„ć¦ć„ć‚‹ć®ćŒć€Vert.x API Generation恧恙怂

GitHub - vert-x3/vertx-codegen: Vert.x code generator for asynchronous polyglot APIs

ć‚ć¾ć‚Šč©³ē“°ć‚’čæ½ć†ć¤ć‚‚ć‚ŠćÆćŖ恄恧恙恌ļ¼ˆļ¼Ÿļ¼‰ć€io.vertx.codegen.Generatorć®å®Ÿč£…ć‚Æćƒ©ć‚¹ć‚’ćƒ­ćƒ¼ćƒ‰ć™ć‚‹
io.vertx.codegen.GeneratorLoaderć®å®Ÿč£…ć‚’META-INF/services/io.vertx.codegen.GeneratorLoaderć§ęŒ‡å®šć™ć‚‹ć€
要ćÆService Loader恮仕ēµ„ćæ悒ä½æć£ć¦ä»„äø‹ć®ć‚ˆć†ćŖ恓ćØ恌恧恍悋恝恆恧恙怂

  • Data object converters
  • Service proxy and service handler
  • RxJava-ified classes API
  • Groovy extension methods API

今回ćÆ态SmallRye Mutinyć‚¹ć‚æć‚¤ćƒ«ć®API悒ē”Ÿęˆć™ć‚‹ć®ć«ä½æć„ć¾ć™ć€ćØ怂

SmalleRye Mutinyå‘ć‘ć«ē”Øę„ć•ć‚Œć¦ć„ć‚‹ć®ćÆ态恓恔悉恧恙恭怂

https://github.com/smallrye/smallrye-reactive-utils/tree/1.2.2/vertx-mutiny-clients/vertx-mutiny-generator

GeneratorLoaderć®ęŒ‡å®šć€‚

https://github.com/smallrye/smallrye-reactive-utils/blob/1.2.2/vertx-mutiny-clients/vertx-mutiny-generator/src/main/resources/META-INF/services/io.vertx.codegen.GeneratorLoader

å…ˆć»ć©čØ˜č¼‰ć—ćŸpom.xml恧恓悓ćŖčؘčæ°ćŒć‚ć‚Šć¾ć—ćŸćŒ

                            <optionMap>
                                <codegen.generators>mutiny</codegen.generators>
                            </optionMap>

ć“ć®ęŒ‡å®šć§ä½æ悏悌悋GeneratorćÆ恓恔悉恫ćŖć‚Šć¾ć™ć€‚

https://github.com/smallrye/smallrye-reactive-utils/blob/1.2.2/vertx-mutiny-clients/vertx-mutiny-generator/src/main/java/io/smallrye/mutiny/vertx/codegen/MutinyGenerator.java

ćØ恄恆悏恑恧态smallrye-mutiny-vertx-redis-client恮pom.xmlć‚’ć‚‚ć†å°‘ć—čŖ­ćæč§£ć„ć¦ćæ悋ćØ怂

vertx-redis-client悒ć‚æćƒ¼ć‚²ćƒƒćƒˆć«ć—ć¦

    <properties>
        <gen-source-groupId>io.vertx</gen-source-groupId>
        <gen-source-artifactId>vertx-redis-client</gen-source-artifactId>
        <gen.output>${project.build.directory}/sources/java</gen.output>
    </properties>

https://github.com/smallrye/smallrye-reactive-utils/blob/1.2.2/vertx-mutiny-clients/vertx-mutiny-redis-client/pom.xml#L14-L18

Maven Dependency Plugin恧vertx-redis-clientć®ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ćƒ€ć‚¦ćƒ³ćƒ­ćƒ¼ćƒ‰ć—ć¦å±•é–‹ć€

            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <includeGroupIds>${gen-source-groupId}</includeGroupIds>
                    <includeArtifactIds>${gen-source-artifactId}</includeArtifactIds>
                    <classifier>sources</classifier>
                    <includeTypes>jar</includeTypes>
                </configuration>
                <executions>
                    <!-- Unpack java sources to target/java-sources -->
                    <execution>
                        <id>unpack-java</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includes>io/vertx/**/*.java</includes>
                            <excludes>**/impl/**/*.java</excludes>
                            <outputDirectory>${gen.output}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

https://github.com/smallrye/smallrye-reactive-utils/blob/1.2.2/vertx-mutiny-clients/vertx-mutiny-redis-client/pom.xml#L53-L76

å±•é–‹ć•ć‚ŒćŸć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ć‚¤ćƒ³ćƒ—ćƒƒćƒˆć«ć€SmallRye Mutiny恫åƾåæœć—ćŸć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ē”Ÿęˆć—ć¦ćƒ‘ćƒƒć‚±ćƒ¼ć‚øćƒ³ć‚°ć—ć¦ć„ć‚‹ć€
ćØć„ć†ć®ćŒå®Ÿä½“ć®ć‚ˆć†ć§ć™ć€‚

https://github.com/smallrye/smallrye-reactive-utils/blob/1.2.2/vertx-mutiny-clients/vertx-mutiny-redis-client/pom.xml#L78-L108

            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>4.2-jdk8</version>
                <configuration>
                    <systemProperties>
                        <java.util.logging.SimpleFormatter.format>%4$s: %3$s - %5$s %6$s%n
                        </java.util.logging.SimpleFormatter.format>
                        <mvel2.disable.jit>true</mvel2.disable.jit>
                    </systemProperties>
                </configuration>
                <executions>
                    <!-- Run the annotation processor on java sources and generate the API -->
                    <execution>
                        <id>generate-api</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceDirectory>${project.build.directory}/sources/java</sourceDirectory>
                            <processors>
                                <processor>io.vertx.codegen.CodeGenProcessor</processor>
                            </processors>
                            <optionMap>
                                <codegen.generators>mutiny</codegen.generators>
                            </optionMap>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

ćŖ悋恻恩态ćØ怂

QuarkusćÆ态恓恮ē”Ÿęˆć•ć‚ŒćŸć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ć•ć‚‰ć«ćƒ©ćƒƒćƒ—ć—ć¦ęä¾›ć—ć¦ć„ć‚‹å½¢ę…‹ć«ćŖć‚Šć¾ć™ć€‚

https://github.com/quarkusio/quarkus/blob/1.9.2.Final/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/client/runtime/ReactiveRedisClientImpl.java

ćØ恄恆恋态恓恮ćƒŖ惝ć‚ø惈ćƒŖć«å«ć¾ć‚Œć‚‹ć‚Æćƒ©ć‚¤ć‚¢ćƒ³ćƒˆćƒ©ć‚¤ćƒ–ćƒ©ćƒŖå…Ø体ēš„恫态恓悓ćŖę„Ÿć˜ć§ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć®č‡Ŗ動ē”Ÿęˆć‚’å…ƒć«
ę§‹ęˆć•ć‚Œć¦ć„ć‚‹ę§˜å­ć§ć™ć­ć€‚

https://github.com/smallrye/smallrye-reactive-utils/tree/1.2.2/vertx-mutiny-clients

ćć®ä»–ć€ć“ć®ćƒŖ惝ć‚ø惈ćƒŖ恫ćÆReactive ConvertersćØć„ć†å¤‰ę›ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖ悂恂悋悈恆ćŖć®ć§ć€ć“ć”ć‚‰ć‚‚č¦šćˆć¦ćŠć„ć¦ć‚ˆć„ć‹ć‚‚ć—ć‚Œć¾ć›ć‚“ć€‚

https://github.com/smallrye/smallrye-reactive-utils/tree/1.2.2/reactive-converters

RxJava 1ļ¼2ćÆć©ć†ć—ćŸļ¼Ÿ

ćØ恓悍恧态Vert.xćÆRxJava 1ćŠć‚ˆć³2恫åƾåæœć—ć¦ć„ćć†ćŖćƒ‰ć‚­ćƒ„ćƒ”ćƒ³ćƒˆćŒć‚ć‚Šć¾ć™ć€‚

Reactive

ćƒŖ惝ć‚ø惈ćƒŖćÆ恓恔悉恧恙怂

GitHub - vert-x3/vertx-rx: Reactive Extensions for Vert.x

äø­čŗ«ć‚’見恦ćæ悋ćØ态恓恔悉悂Vert.x API Generation悒ä½æć£ć¦Vert.x恮API恋悉č‡Ŗ動ē”Ÿęˆć—ćŸć‚‚ć®ć§ć—ćŸć€‚

åŒć˜ä»•ēµ„ćæ恧恙恭ļ¼

API Constraint

恓悓ćŖꄟ恘恧ę›øć„ć¦ć„ććØć€ć‚ć‚‹ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‹ć‚‰ē‰¹å®šć®Reactive Streamsć®å®Ÿč£…ć«åƾåæœć—ćŸć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’å‡ŗåŠ›ć—ć¦ćć‚Œćć†ćŖ
ć™ć”ć„ć‚‚ć®ć®ć‚ˆć†ćŖå°č±”ć‚’å—ć‘ć¾ć™ćŒć€ćć‚ŒćŖć‚Šć«åˆ¶é™ćÆć‚ć‚Šć¾ć™ć€‚

API constraints

恝悂恝悂恌Pluggable Annotation Processing APIć§å®Ÿē¾ć•ć‚Œć¦ć„悋仕ēµ„ćæćŖć®ć§ć‚¢ćƒŽćƒ†ćƒ¼ć‚·ćƒ§ćƒ³ć®ä»˜äøŽćŒåæ…要恧恙恗态
ć‚¢ćƒŽćƒ†ćƒ¼ć‚·ćƒ§ćƒ³ćŒä»˜äøŽć•ć‚Œć‚‹åÆ¾č±”ćÆć‚¤ćƒ³ć‚æćƒ¼ćƒ•ć‚§ćƒ¼ć‚¹ć§ć‚ć‚‹ć“ćØćØć‹ć„ć‚ć„ć‚ć‚ć‚Šć¾ć™ć€‚

恟ćØćˆć°ć€ä»„äø‹ć®ć‚¤ćƒ³ć‚æćƒ¼ćƒ•ć‚§ćƒ¼ć‚¹ćŒVert.x API Generationć«é–¢ć™ć‚‹ć‚¢ćƒŽćƒ†ćƒ¼ć‚·ćƒ§ćƒ³ćŒä»˜äøŽć•ć‚ŒćŸć‚Æćƒ©ć‚¹ć§ć™ć­ć€‚

https://github.com/vert-x3/vertx-redis-client/blob/3.9.4/src/main/java/io/vertx/redis/client/RedisAPI.java

ć¤ć¾ć‚Šć€ć“ć®ć‚¤ćƒ³ć‚æćƒ¼ćƒ•ć‚§ćƒ¼ć‚¹ćÆć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ē”ŸęˆåÆ¾č±”ćØćŖć‚Šć¾ć™ć€‚

ćØ恄恆悏恑恧

ćØć¾ć‚ć€ć“ć“ć¾ć§ć§ē†å±ˆćÆćŖ悓ćØćŖćć‚ć‹ć‚Šć¾ć—ćŸć€‚

恓恓恧ēµ‚ć‚ć£ć¦ć‚‚ć„ć„ć®ć§ć™ćŒć€1åŗ¦č‡Ŗåˆ†ć§ć‚³ćƒ¼ćƒ‰ē”Ÿęˆć‚’č”Œć£ć¦ćæć¦ć‚‚ć‚ˆć„ć®ć§ćÆćŖ恄恧恗悇恆恋怂

ćØ恄恆悏恑恧态smallrye-mutiny-vertx-redis-clientć‚’å‚č€ƒć«ć€č‡Ŗåˆ†ć§vertx-redis-client悒SmallRye Mutiny恫åƾåæœć•ć›ć¦ćæć¾ć—ć‚‡ć†ć€‚

https://github.com/smallrye/smallrye-reactive-utils/tree/1.2.2/vertx-mutiny-clients/vertx-mutiny-redis-client

ć‚³ćƒ¼ćƒ‰ē”ŸęˆćŠć‚ˆć³JARć®ä½œęˆćØ态恝悌悒ä½æć£ćŸćƒ†ć‚¹ćƒˆć‚³ćƒ¼ćƒ‰ć«ć‚ˆć‚‹ē°”単ćŖ動作ē¢ŗčŖć‚’ć‚“ćƒ¼ćƒ«ć«ć—ć¾ć™ć€‚

恓悌悉ćÆ态Mavenć®ćƒžćƒ«ćƒćƒ—ćƒ­ć‚ø悧ć‚Æ惈恧꧋ꈐ恙悋ćØć—ć¾ć—ć‚‡ć†ć€‚

ē’°å¢ƒ

ä»Šå›žć®ē’°å¢ƒćÆ态恓恔悉恧恙怂

$ java --version
openjdk 11.0.9.1 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)


$ mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: $HOME/.sdkman/candidates/maven/current
Java version: 11.0.9.1, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: ja_JP, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-54-generic", arch: "amd64", family: "unix"

Vert.xćÆ3.9.4悒ä½æē”Øć—ć¾ć™ć€‚

č¦Ŗ惗惭ć‚ø悧ć‚Æ惈

č¦Ŗ惗惭ć‚ø悧ć‚Æ惈悒ē”Øę„ć—ć¾ć™ć€‚å«ć¾ć‚Œć‚‹ć‚µćƒ–ćƒ¢ć‚øćƒ„ćƒ¼ćƒ«ćŒå®šē¾©ć•ć‚Œć¦ć„ć‚‹ć ć‘ć§ć™ćŒć€‚
pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.littlewings</groupId>
    <artifactId>vertx-codegen-redis-example</artifactId>
    <packaging>pom</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <modules>
        <module>hello-redis-client</module>
        <module>my-smallrye-mutiny-vertx-redis-client</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
</project>

my-smallrye-mutiny-vertx-redis-client恌č‡Ŗå‰ć§ä½œć‚‹ć€SmallRye Mutiny恫åƾåæœć—ćŸRedisć‚Æćƒ©ć‚¤ć‚¢ćƒ³ćƒˆć€
hello-redis-client恌my-smallrye-mutiny-vertx-redis-client悒ä½æć£ćŸćƒ†ć‚¹ćƒˆć‚³ćƒ¼ćƒ‰ć‚’ę›øćå½¢ć«ć—ć¾ć™ć€‚

    <modules>
        <module>hello-redis-client</module>
        <module>my-smallrye-mutiny-vertx-redis-client</module>
    </modules>

vertx-redis-client悒SmallRye Mutiny恫åƾåæœć•ć›ć‚‹

恧ćÆ态vertx-redis-client悒SmallRye Mutiny恫åƾåæœć•ć›ć‚‹ćƒ—ćƒ­ć‚ø悧ć‚Æćƒˆć‚’ä½œć‚Šć¾ć™ć€‚č‡Ŗå‰ć®smallrye-mutiny-vertx-redis-client恧恙怂

ćØć„ć£ć¦ć‚‚ć€ē”Øę„ć™ć‚‹ć®ćÆpom.xmlć ć‘ć§ć„ć„ć®ć§ć™ćŒć€‚

Vert.x API Generation恮README.md悒見悋ćØ态Maven Compiler Plugin恧恮čØ­å®šćŒč”Œć‚ć‚Œć¦ć„ć‚‹ć®ć§ć™ćŒ

Processor configuration

ć‚ŖćƒŖć‚øćƒŠćƒ«ć®smallrye-mutiny-vertx-redis-client悒見悋ćØ态Maven Processor Plugin恧čØ­å®šćŒč”Œć‚ć‚Œć¦ć„ć¾ć™ć€‚

https://github.com/smallrye/smallrye-reactive-utils/blob/1.2.2/vertx-mutiny-clients/vertx-mutiny-redis-client/pom.xml#L78-L108

ć“ć”ć‚‰ć®ćƒ—ćƒ©ć‚°ć‚¤ćƒ³ć§ć™ć­ć€‚

MAVEN PROCESSOR PLUGIN – About

RxJavaå‘ć‘ć®ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ē”Ÿęˆć—ć¦ć„ć‚‹ćƒ—ćƒ­ć‚ø悧ć‚Æćƒˆć‚’č¦‹ć¦ć‚‚ć€åŒć˜ć§ć—ćŸć€‚

GitHub - vert-x3/vertx-rx: Reactive Extensions for Vert.x

ć©ć†ć—ć‚ˆć†ć‹ćØčæ·ć£ćŸćØ恓悍恧态äø”ę–¹ć‚„ć‚Šć¾ć—ć‚‡ć†ć€‚

悄悋恓ćØćÆć€ę¬”ć®å†…å®¹ć§ć™ć€‚

  • vertx-redis-clientć‚’ćƒ™ćƒ¼ć‚¹ć«ć€SmallRye Mutiny恫åƾåæœć™ć‚‹ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć‚’ä½œć‚‹
  • vertx-redis-clientć®ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ćÆMaven Dependency Plugin悒ä½æć„ć€ćƒ€ć‚¦ćƒ³ćƒ­ćƒ¼ćƒ‰ć™ć‚‹
    • ćƒ€ć‚¦ćƒ³ćƒ­ćƒ¼ćƒ‰ć—ćŸć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć®å±•é–‹å…ˆćÆ${project.build.directory}/sources/javaćØ恙悋ļ¼ˆć‚ŖćƒŖć‚øćƒŠćƒ«ć®smallrye-mutiny-vertx-redis-clientćØåŒć˜ļ¼‰
    • ć“ć“ć«é…ē½®ć•ć‚ŒćŸć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’Vert.x API Generation恮Pluggable Annotation Processing APIć§å‡¦ē†ć™ć‚‹
  • Vert.x API Generationć§å‡¦ē†ć™ć‚‹éš›ć«ćÆ态SmallRye Mutinyå‘ć‘ć®Generatorć‚’ęŒ‡å®šć™ć‚‹

恩恔悉恮Mavenćƒ—ćƒ©ć‚°ć‚¤ćƒ³ć‚’ä½æć£ćŸę–¹ę³•ć§ć‚‚å…±é€šć™ć‚‹éƒØ分ćÆć€ęœ€åˆć«č²¼ć£ć¦ćŠćć¾ć™ļ¼ˆęœ€å¾Œć«å…Ø体ćÆč¼‰ć›ć¾ć™ļ¼‰ć€‚

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>vertx-codegen-redis-example</artifactId>
        <groupId>org.littlewings</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>my-smallrye-mutiny-vertx-redis-client</artifactId>

怜ēœē•„怜

</project>
Maven Compiler Pluginć§ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ē”Ÿęˆć™ć‚‹

ęœ€åˆćÆ态Vert.x API Generation恮README.md恫ę²æć£ć¦ć€Maven Compiler Plugin恧čØ­å®šć‚’č”Œć„ć¾ć™ć€‚

ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖ依存関äæ‚ćÆć‚ŖćƒŖć‚øćƒŠćƒ«ć®smallrye-mutiny-vertx-redis-client恫ēæ’ć„ć¾ć™ćŒć€ć“ć”悉恮vertx-codegenć®ę˜Žē¤ŗēš„ćŖčæ½åŠ ćŒ
åæ…要恧恙怂

    <dependencies>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-redis-client</artifactId>
            <version>3.9.4</version>
        </dependency>

        <dependency>
            <groupId>io.smallrye.reactive</groupId>
            <artifactId>smallrye-mutiny-vertx-core</artifactId>
            <version>1.2.2</version>
        </dependency>

        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-codegen</artifactId>
            <classifier>processor</classifier>
            <version>3.9.4</version>
            <optional>true</optional>
        </dependency>
    </dependencies>

vertx-codegen恌åæ…要ćŖ恮ćÆćƒ‰ć‚­ćƒ„ćƒ”ćƒ³ćƒˆé€šć‚ŠćŖć®ć§ć™ćŒć€Maven Processor Plugin悒ä½æć£ćŸę™‚ćÆ依存関äæ‚ć«åŠ ćˆćŖćć¦ć‚‚
å‹•ä½œć™ć‚‹ć‚“ć§ć™ć‚ˆć­ć‡ā€¦ć€‚

Processor configuration

恔ćŖćæ恫态vertx-codegenćøć®ä¾å­˜é–¢äæ‚ćÆsmallrye-mutiny-vertx-coreć«å«ć¾ć‚Œć¦ć„ć‚‹ć®ć§ć™ćŒć€processor classifier恮悂恮悒
依存関äæ‚ć«åŠ ćˆć‚‹åæ…č¦ćŒć‚ć‚Šć¾ć™ć€‚

processor classifier꜉ē„”ć®å·®ćÆ态恩恆悄悉META-INF/services/javax.annotation.processing.ProcessorćŒå«ć¾ć‚Œć¦ć„ć‚‹ć‹
ć©ć†ć‹ć®ć‚ˆć†ć§ć€ć“ć‚ŒćŒćŖ恄ćØMaven Compiler Pluginć®å “åˆćÆPluggable Annotation Processing APIćŒčµ·å‹•ć—ćŖ恄ā€¦ćØ恄恆恋态
ćć‚ŒćŒćµć¤ć†ć§ć™ć­ā€¦ć€‚

Maven Processor Plugin恌äøę€č­°ćŖ恮恋ā€¦ć€‚

恂ćØćÆMavenćƒ—ćƒ©ć‚°ć‚¤ćƒ³ć®čØ­å®šć§ć™ć€‚ć“ć‚“ćŖę„Ÿć˜ć«ć—ć¾ć—ćŸć€‚

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <includeGroupIds>io.vertx</includeGroupIds>
                    <includeArtifactIds>vertx-redis-client</includeArtifactIds>
                    <classifier>sources</classifier>
                    <includeTypes>jar</includeTypes>
                </configuration>
                <executions>
                    <execution>
                        <id>unpack-java</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includes>io/vertx/**/*.java</includes>
                            <excludes>**/impl/**/*.java</excludes>
                            <outputDirectory>${project.build.directory}/sources/java</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/sources/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <useIncrementalCompilation>false</useIncrementalCompilation>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-mutiny-source</id>
                        <configuration>
                            <annotationProcessors>
                                <annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
                            </annotationProcessors>
                            <compilerArgs>
                                <arg>-Acodegen.generators=mutiny</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Maven Dependency Plugin恧vertx-redis-clientć®ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’å–å¾—ć—ć¦ć€${project.build.directory}/sources/javać«å±•é–‹ć€‚
includes悄excludesć®ęŒ‡å®šćÆ态ć‚ŖćƒŖć‚øćƒŠćƒ«ć®smallrye-mutiny-vertx-redis-client恮čØ­å®šć‚’ćć®ć¾ć¾ä½æć£ć¦ć„ć¾ć™ć€‚

            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <includeGroupIds>io.vertx</includeGroupIds>
                    <includeArtifactIds>vertx-redis-client</includeArtifactIds>
                    <classifier>sources</classifier>
                    <includeTypes>jar</includeTypes>
                </configuration>
                <executions>
                    <execution>
                        <id>unpack-java</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includes>io/vertx/**/*.java</includes>
                            <excludes>**/impl/**/*.java</excludes>
                            <outputDirectory>${project.build.directory}/sources/java</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

å±•é–‹ć—ćŸvertx-redis-clientć®ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ć€ćƒ“ćƒ«ćƒ‰åÆ¾č±”ć«čæ½åŠ ć€‚

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/sources/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

ęœ€å¾Œć«ć€Vert.x API Generation悒ä½æć£ć¦ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ē”Ÿęˆć—ć¾ć™ć€‚

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <useIncrementalCompilation>false</useIncrementalCompilation>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-mutiny-source</id>
                        <configuration>
                            <annotationProcessors>
                                <annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
                            </annotationProcessors>
                            <compilerArgs>
                                <arg>-Acodegen.generators=mutiny</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

ć‚¢ćƒŽćƒ†ćƒ¼ć‚·ćƒ§ćƒ³ćƒ—ćƒ­ć‚»ćƒƒć‚µćƒ¼ćŠć‚ˆć³SmallRye Mutinyå‘ć‘ć®Generatorć®ęŒ‡å®šćÆ态恓恓恧恙恭怂

                            <annotationProcessors>
                                <annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
                            </annotationProcessors>
                            <compilerArgs>
                                <arg>-Acodegen.generators=mutiny</arg>
                            </compilerArgs>

ćƒ“ćƒ«ćƒ‰ć—ć¦ćæć¾ć—ć‚‡ć†ć€‚

$ mvn package

ć§ćć‚ćŒć£ćŸJARćƒ•ć‚”ć‚¤ćƒ«ć«ćÆ态io.vertx.mutinyćƒ‘ćƒƒć‚±ćƒ¼ć‚øć«å±žć™ć‚‹ć‚Æćƒ©ć‚¹ćŒå«ć¾ć‚Œć‚‹ć‚ˆć†ć«ćŖć£ć¦ć„ć¾ć™ć€‚

$ jar -tvf target/my-smallrye-mutiny-vertx-redis-client-0.0.1-SNAPSHOT.jar 
     0 Mon Nov 23 23:01:18 JST 2020 META-INF/
   133 Mon Nov 23 23:01:16 JST 2020 META-INF/MANIFEST.MF
     0 Mon Nov 23 23:01:16 JST 2020 io/
     0 Mon Nov 23 23:01:16 JST 2020 io/vertx/
     0 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/
     0 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/
     0 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/
     0 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/sentinel/
182280 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/RedisTransaction.class
  3083 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/Script.class
196928 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/RedisClient.class
  1923 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/RedisTransaction$1.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$90.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$83.class
  1963 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$78.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$58.class
  1909 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$2.class
  1967 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$45.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$54.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$47.class
  1911 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$19.class
  1916 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$108.class
  1949 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$153.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$75.class
  1915 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$98.class
  1934 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$200.class
  1945 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$49.class
  1993 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/client/RedisConnection$2.class
  1936 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$116.class
  1369 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/client/RedisConnection$1.class
  1969 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$134.class
  1966 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$132.class
  1931 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$148.class
  1967 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$101.class
  1930 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$115.class
  1912 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$85.class
  1930 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$179.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$97.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$27.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$170.class
  1947 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$31.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$178.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$11.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$28.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$143.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$169.class
  1915 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$4.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$173.class
  1952 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$119.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$3.class
  1935 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$107.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$55.class
  1970 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$183.class
  1914 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$161.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$120.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$74.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$34.class
  1947 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$162.class
  1969 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$12.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$121.class
  1977 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$193.class
  1967 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$180.class
  1932 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$149.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$99.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$72.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$43.class
  1947 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$46.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$56.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$21.class
  1948 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$61.class
  1984 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$71.class
  5154 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/client/Request.class
  1930 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$184.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$6.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$167.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$100.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$87.class
  1923 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/Redis$2.class
  1931 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$135.class
  2983 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/client/RedisConnection$3.class
  1948 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$133.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$33.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$147.class
  1949 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$32.class
 15791 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/client/RedisConnection.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$95.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$76.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$165.class
  1933 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$128.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$177.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$81.class
  1951 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$197.class
129895 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$104.class
  1947 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$22.class
  1948 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$92.class
  1924 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$8.class
  1950 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$105.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$59.class
  1967 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$150.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$157.class
  1912 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$24.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$163.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$30.class
  1934 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$152.class
  1938 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$41.class
  1933 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$141.class
  9056 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/Redis.class
  1931 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$171.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$10.class
  1966 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$142.class
  1910 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$89.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$9.class
  1949 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$176.class
  1931 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$113.class
  1968 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$181.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$36.class
  1932 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$175.class
  1947 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$70.class
  1949 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$111.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$67.class
  1934 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$137.class
  1933 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$174.class
 14133 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/client/Command.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$5.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$96.class
  1976 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$192.class
  1947 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$64.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$136.class
  1966 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$51.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$156.class
  1934 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$145.class
  1930 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$50.class
  1951 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$112.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$151.class
  1930 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$185.class
  1950 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$93.class
  1964 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$80.class
  1945 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$1.class
  1937 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$195.class
  1930 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$39.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$62.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$73.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$158.class
  1939 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$196.class
  1967 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$131.class
  1909 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$29.class
  1965 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$60.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$66.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$146.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$26.class
  1913 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$68.class
  1930 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$125.class
  1932 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$194.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$186.class
  1936 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$188.class
  1948 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$189.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$94.class
  5522 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/client/Response.class
  1971 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$52.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$106.class
  1952 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$138.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$18.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$164.class
  1949 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$199.class
  1948 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$103.class
  1916 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$110.class
  1911 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$154.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$16.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$122.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$198.class
  1940 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$42.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$37.class
  1931 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$129.class
  1915 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$109.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$15.class
  1934 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$160.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$69.class
  1938 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/Redis$1.class
  1963 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$79.class
  1947 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$44.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$190.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$144.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$7.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$14.class
  1975 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$191.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$172.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$124.class
  1932 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$40.class
  1911 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$123.class
  1911 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$117.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$127.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$130.class
  1945 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$86.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$118.class
  1911 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$155.class
  1928 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$53.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$88.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$82.class
  2913 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/Redis$3.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$166.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$13.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$38.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$126.class
  1933 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$102.class
  1965 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$77.class
  1934 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$182.class
  1926 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$20.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$35.class
  1952 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$65.class
  1912 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$17.class
  1934 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$187.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$25.class
  1925 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$57.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$168.class
  1948 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$48.class
  1930 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$140.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$84.class
  1952 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$114.class
  1929 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$159.class
  1930 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$91.class
  1924 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$23.class
  1950 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$139.class
  1927 Mon Nov 23 23:01:18 JST 2020 io/vertx/mutiny/redis/client/RedisAPI$63.class
 10817 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/sentinel/RedisSentinel.class
  1888 Mon Nov 23 23:01:16 JST 2020 io/vertx/mutiny/redis/RedisClient$1.class
     0 Mon Nov 23 23:01:18 JST 2020 META-INF/maven/
     0 Mon Nov 23 23:01:18 JST 2020 META-INF/maven/org.littlewings/
     0 Mon Nov 23 23:01:18 JST 2020 META-INF/maven/org.littlewings/my-smallrye-mutiny-vertx-redis-client/
  3479 Mon Nov 23 22:21:48 JST 2020 META-INF/maven/org.littlewings/my-smallrye-mutiny-vertx-redis-client/pom.xml
   146 Mon Nov 23 23:01:18 JST 2020 META-INF/maven/org.littlewings/my-smallrye-mutiny-vertx-redis-client/pom.properties

ē”Ÿęˆć•ć‚ŒćŸć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ćÆ态恓恔悉怂

$ find target/generated-sources -type f
target/generated-sources/apt/io/vertx/mutiny/redis/Script.java
target/generated-sources/apt/io/vertx/mutiny/redis/RedisTransaction.java
target/generated-sources/apt/io/vertx/mutiny/redis/RedisClient.java
target/generated-sources/apt/io/vertx/mutiny/redis/client/Request.java
target/generated-sources/apt/io/vertx/mutiny/redis/client/Command.java
target/generated-sources/apt/io/vertx/mutiny/redis/client/RedisConnection.java
target/generated-sources/apt/io/vertx/mutiny/redis/client/Redis.java
target/generated-sources/apt/io/vertx/mutiny/redis/client/Response.java
target/generated-sources/apt/io/vertx/mutiny/redis/client/RedisAPI.java
target/generated-sources/apt/io/vertx/mutiny/redis/sentinel/RedisSentinel.java

ē”Ÿęˆć•ć‚ŒćŸć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć®é›°å›²ę°—ćÆ态恓悓ćŖꄟ恘恧恙怂
target/generated-sources/annotations/io/vertx/mutiny/redis/client/RedisAPI.java

package io.vertx.mutiny.redis.client;

import java.util.Map;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import java.util.function.Consumer;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Publisher;
import java.util.List;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;

/**
 * <b>Auto generated</b> Redis API client wrapper.
 *
 * <p/>
 * NOTE: This class has been automatically generated from the {@link io.vertx.redis.client.RedisAPI original} non Mutiny-ified interface using Vert.x codegen.
 */

@io.smallrye.mutiny.vertx.MutinyGen(io.vertx.redis.client.RedisAPI.class)
public class RedisAPI {

  public static final io.smallrye.mutiny.vertx.TypeArg<RedisAPI> __TYPE_ARG = new io.smallrye.mutiny.vertx.TypeArg<>(    obj -> new RedisAPI((io.vertx.redis.client.RedisAPI) obj),
    RedisAPI::getDelegate
  );

  private final io.vertx.redis.client.RedisAPI delegate;
  
  public RedisAPI(io.vertx.redis.client.RedisAPI delegate) {
    this.delegate = delegate;
  }

  /**
  * Empty constructor used by CDI, do not use this constructor directly.
  **/
  RedisAPI() {    this.delegate = null;
  }

  public io.vertx.redis.client.RedisAPI getDelegate() {
    return delegate;
  }

  @Override
  public String toString() {
    return delegate.toString();
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    RedisAPI that = (RedisAPI) o;
    return delegate.equals(that.delegate);
  }
  
  @Override
  public int hashCode() {
    return delegate.hashCode();
  }

  public void close() { 
    delegate.close();
  }

  /**
   * @param arg0 
   * @param arg1 
   * @param handler 
   * @return fluent self
   */
  private io.vertx.mutiny.redis.client.RedisAPI __append(String arg0, String arg1, Handler<AsyncResult<io.vertx.mutiny.redis.client.Response>> handler) { 
    delegate.append(arg0, arg1, new Handler<AsyncResult<io.vertx.redis.client.Response>>() {
      public void handle(AsyncResult<io.vertx.redis.client.Response> ar) {
        if (ar.succeeded()) {
          handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.mutiny.redis.client.Response.newInstance(ar.result())));
        } else {
          handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
        }
      }
    });
    return this;
  }

  /**
   * Redis command <a href="https://redis.io/commands/append">append</a>.
   * <p>
   * Unlike the <em>bare</em> Vert.x variant, this method returns a {@link io.smallrye.mutiny.Uni Uni}.
   * Don't forget to <em>subscribe</em> on it to trigger the operation.
   * @param arg0 
   * @param arg1 
   * @return fluent self
   */
  public Uni<io.vertx.mutiny.redis.client.Response> append(String arg0, String arg1) { 
    return io.smallrye.mutiny.vertx.AsyncResultUni.toUni(handler -> {
      __append(arg0, arg1, handler);
    });
  }

怜ēœē•„怜
}

ē”Ÿęˆå…ƒć®RedisAPIć‚¤ćƒ³ć‚æćƒ¼ćƒ•ć‚§ćƒ¼ć‚¹ćÆ态恓悓ćŖꄟ恘恧恗恟怂

怜ēœē•„怜

@VertxGen
public interface RedisAPI {

  @GenIgnore(PERMITTED_TYPE)
  static RedisAPI api(Redis client) {
    return new RedisAPIImpl(client);
  }

  @GenIgnore(PERMITTED_TYPE)
  static RedisAPI api(RedisConnection connection) {
    return new RedisAPIImpl(connection);
  }

  void close();

  /**
   * Redis command <a href="https://redis.io/commands/append">append</a>.
   * @return fluent self
   */
  @Fluent
  default RedisAPI append(String arg0, String arg1, Handler<AsyncResult<@Nullable Response>> handler) {
    send(Command.APPEND, arg0, arg1).setHandler(handler);
    return this;
  }

  /**
   * Redis command <a href="https://redis.io/commands/asking">asking</a>.
   * @return fluent self
   */
  @Fluent
  default RedisAPI asking(Handler<AsyncResult<@Nullable Response>> handler) {
    send(Command.ASKING).setHandler(handler);
    return this;
  }

怜ēœē•„怜
}

https://github.com/vert-x3/vertx-redis-client/blob/3.9.4/src/main/java/io/vertx/redis/client/RedisAPI.java

ćØć‚Šć‚ćˆćšć€ć“ć”ć‚‰ćÆć“ć“ć¾ć§ć€‚

Maven Processor Pluginć§ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ē”Ÿęˆć™ć‚‹

ē¶šć„恦ćÆ态Maven Processor Plugin悒ä½æć„ć¾ć™ć€‚

ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć®ä¾å­˜é–¢äæ‚ćÆ态恓悌恠恑恧OK恧恙怂

    <dependencies>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-redis-client</artifactId>
            <version>3.9.4</version>
        </dependency>

        <dependency>
            <groupId>io.smallrye.reactive</groupId>
            <artifactId>smallrye-mutiny-vertx-core</artifactId>
            <version>1.2.2</version>
        </dependency>
    </dependencies>

Mavenćƒ—ćƒ©ć‚°ć‚¤ćƒ³ć®čح定ćÆ态恓悓ćŖę„Ÿć˜ć«ć€‚

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <includeGroupIds>io.vertx</includeGroupIds>
                    <includeArtifactIds>vertx-redis-client</includeArtifactIds>
                    <classifier>sources</classifier>
                    <includeTypes>jar</includeTypes>
                </configuration>
                <executions>
                    <execution>
                        <id>unpack-java</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includes>io/vertx/**/*.java</includes>
                            <excludes>**/impl/**/*.java</excludes>
                            <outputDirectory>${project.build.directory}/sources/java</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>4.4-jdk8</version>
                <configuration>
                    <systemProperties>
                        <java.util.logging.SimpleFormatter.format>%4$s: %3$s - %5$s %6$s%n</java.util.logging.SimpleFormatter.format>
                        <mvel2.disable.jit>true</mvel2.disable.jit>
                    </systemProperties>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceDirectory>${project.build.directory}/sources/java</sourceDirectory>
                            <processors>
                                <processor>io.vertx.codegen.CodeGenProcessor</processor>
                            </processors>
                            <optionMap>
                                <codegen.generators>mutiny</codegen.generators>
                            </optionMap>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Maven Dependency Plugin恮čح定ćÆć€å…ˆć»ć©ćØć¾ć£ćŸćåŒć˜ćŖć®ć§å‰²ę„›ć—ć¾ć™ć€‚

違恆恮ćÆć“ć”ć‚‰ć€‚ćƒ—ćƒ­ć‚ø悧ć‚Æćƒˆć®ć‚½ćƒ¼ć‚¹ćƒ‡ć‚£ćƒ¬ć‚Æ惈ćƒŖćØ恗恦vertx-redis-clientć®å±•é–‹å…ˆć‚’sourceDirectoryć§ęŒ‡å®šć—ć¦ć„ć¾ć™ć€‚

            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>4.4-jdk8</version>
                <configuration>
                    <systemProperties>
                        <java.util.logging.SimpleFormatter.format>%4$s: %3$s - %5$s %6$s%n</java.util.logging.SimpleFormatter.format>
                        <mvel2.disable.jit>true</mvel2.disable.jit>
                    </systemProperties>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceDirectory>${project.build.directory}/sources/java</sourceDirectory>
                            <processors>
                                <processor>io.vertx.codegen.CodeGenProcessor</processor>
                            </processors>
                            <optionMap>
                                <codegen.generators>mutiny</codegen.generators>
                            </optionMap>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

ć‚¢ćƒŽćƒ†ćƒ¼ć‚·ćƒ§ćƒ³ćƒ—ćƒ­ć‚»ćƒƒć‚µćƒ¼ć®ęŒ‡å®šćŠć‚ˆć³SmalleRye Mutinyå‘ć‘ć®Generatorć®ęŒ‡å®šćÆ态恓恔悉怂

                            <processors>
                                <processor>io.vertx.codegen.CodeGenProcessor</processor>
                            </processors>
                            <optionMap>
                                <codegen.generators>mutiny</codegen.generators>
                            </optionMap>

ćƒ‘ćƒƒć‚±ćƒ¼ć‚øćƒ³ć‚°ć€‚

$ mvn package

ēµęžœćÆć»ć¼åŒć˜ćŖć®ć§ć€å‰²ę„›ć—ć¾ć™ć€‚

ē”Ÿęˆć—ćŸćƒ©ć‚¤ćƒ–ćƒ©ćƒŖ悒ä½æ恆

恧ćÆ态ē”Ÿęˆć—ćŸćƒ©ć‚¤ćƒ–ćƒ©ćƒŖ悒ä½æć£ć¦ćæć¾ć—ć‚‡ć†ć€‚ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖ依存関äæ‚ćØMavenćƒ—ćƒ©ć‚°ć‚¤ćƒ³ć®čح定ćÆ态恓恔悉怂

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>my-smallrye-mutiny-vertx-redis-client</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.18.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
            </plugin>
        </plugins>
    </build>

ćƒ†ć‚¹ćƒˆć‚³ćƒ¼ćƒ‰ć§ē¢ŗčŖć™ć‚‹ć“ćØć«ć—ć¾ć™ć€‚

č‡Ŗå‰ć®ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖ恮éƒØ分ćÆ态恓恔悉恧恙恭怂

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>my-smallrye-mutiny-vertx-redis-client</artifactId>
            <version>${project.version}</version>
        </dependency>

ćƒ†ć‚¹ćƒˆć‚³ćƒ¼ćƒ‰ć€‚
src/test/java/org/littlewings/vertx/codegen/mutiny/ReactiveRedisTest.java

package org.littlewings.vertx.codegen.mutiny;

import java.util.List;

import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.core.Vertx;
import io.vertx.mutiny.redis.client.Redis;
import io.vertx.mutiny.redis.client.RedisAPI;
import io.vertx.mutiny.redis.client.Response;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class ReactiveRedisTest {
    @Test
    public void putAndGet() {
        Vertx vertx = Vertx.vertx();

        Redis redis = Redis.createClient(vertx, "redis://redispass@172.17.0.2:6379/1");
        RedisAPI redisApi = RedisAPI.api(redis);

        Uni<Response> setResponse = redisApi.set(List.of("key1", "value1"));
        Uni<Response> getResponse = setResponse.flatMap(r -> redisApi.get("key1"));

        Response actualGetResponse = getResponse
                .await()
                .indefinitely();

        assertThat(actualGetResponse.toString())
                .isEqualTo("value1");
    }
}

RedisćÆ态172.17.0.2ć§ćƒ‘ć‚¹ćƒÆćƒ¼ćƒ‰ć€Œredispassć€ć§čµ·å‹•ć—ć¦ć„ć‚‹ć‚‚ć®ćØć—ć¾ć™ć€‚ćŖćŠć€ćƒćƒ¼ć‚øćƒ§ćƒ³ćÆ6.0.9悒ä½æē”Øć—ć¾ć—ćŸć€‚

        Redis redis = Redis.createClient(vertx, "redis://redispass@172.17.0.2:6379/1");

恂ćØćÆ态SmallRye Mutinyå‘ć‘ć«ē”Ÿęˆć•ć‚ŒćŸAPI悒ä½æć£ć¦ćƒ†ć‚¹ćƒˆć‚’ę›ø恄恦ē¢ŗčŖć€‚

    @Test
    public void putAndGet() {
        Vertx vertx = Vertx.vertx();

        Redis redis = Redis.createClient(vertx, "redis://redispass@172.17.0.2:6379/1");
        RedisAPI redisApi = RedisAPI.api(redis);

        Uni<Response> setResponse = redisApi.set(List.of("key1", "value1"));
        Uni<Response> getResponse = setResponse.flatMap(r -> redisApi.get("key1"));

        Response actualGetResponse = getResponse
                .await()
                .indefinitely();

        assertThat(actualGetResponse.toString())
                .isEqualTo("value1");
    }

ć™ć¹ć¦ć€SmalleRye Mutinyå‘ć‘ć®ćƒ‘ćƒƒć‚±ćƒ¼ć‚ø恧恙怂Vertx恙悉态Mutinyå‘ć‘ć®ć‚‚ć®ćŒć‚ć‚‹ć®ć«ę³Øꄏ恧恙怂

import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.core.Vertx;
import io.vertx.mutiny.redis.client.Redis;
import io.vertx.mutiny.redis.client.RedisAPI;
import io.vertx.mutiny.redis.client.Response;

SmallRye Mutinyå‘ć‘ć®Vertx恮ē”Ÿęˆå…ƒćÆ态恓恔悉恧恙恭怂

https://github.com/smallrye/smallrye-reactive-utils/tree/1.2.2/vertx-mutiny-clients/vertx-mutiny-core

ćƒ†ć‚¹ćƒˆćÆć€ć“ć‚Œć§ćƒ‘ć‚¹ć™ć‚‹ć®ć§ęœ€ä½Žé™ćÆOKćØ恄恆恓ćØ恧怂

Maven Compiler PluginćØMaven Processor Plugin恮ä½æć„åˆ†ć‘ćÆ态ć‚ŖćƒŖć‚øćƒŠćƒ«ć®ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć‹ć‚‰ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’č‡Ŗ動ē”Ÿęˆć™ć‚‹ć ć‘恧ćÆ
ćŖćć¦ć€src/main/java恫čæ½åŠ ć§č‡Ŗä½œć®ć‚‚ć®ćŒć‚ć£ćŸć‚Šć™ć‚‹å “åˆć«éø恶恮恋ćŖļ¼ŸćØć‚‚ę€ć£ćŸć®ć§ć™ćŒć€vertx-mutiny-core恮
ę§‹ęˆć‚’č¦‹ć‚‹é™ć‚Šćć†ć§ć‚‚ćŖ恕恝恆恧恙ā€¦ć€‚恓恔悉悂Maven Processr Plugin怂

https://github.com/smallrye/smallrye-reactive-utils/tree/1.2.2/vertx-mutiny-clients/vertx-mutiny-core

ć¾ć‚ć€ć„ć„ć‹ćŖā€¦ļ¼Ÿ

ć¾ćØ悁

Vert.x API Generationć«ć¤ć„ć¦ć”ć‚‡ć£ćØčŖæć¹ć¦ćæćŸć®ćØ态č‡Ŗåˆ†ć§ć‚‚ä»–ć®ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć‹ć‚‰ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć‚’ē”Ÿęˆć™ć‚‹ä¾‹ć‚’試恗恦
ćæć¾ć—ćŸć€‚

恓悌恧态SmallRye Mutiny恫åƾåæœć•ć‚Œć¦ć„ć‚‹ć‚„ć‚Šę–¹ćÆćŖ悓ćØćŖ恏悏恋悋恧恗悇恆怂

ćØ恄恆恮ćØ态恂ćØ恧恓恮ć‚Øćƒ³ćƒˆćƒŖć‚’č¦‹ć‚Œć°ę€ć„å‡ŗ恙恧恗悇恆ā€¦ć€‚

ęœ€å¾Œć«ć€č‡Ŗå‰ć®smallrye-mutiny-vertx-redis-client悒ē”Ÿęˆć™ć‚‹pom.xml恮å…Øä½“ć‚’2ēØ®é”žč¼‰ć›ć¦ćŠćć¾ć™ć€‚
ćƒžćƒ«ćƒćƒ¢ć‚øćƒ„ćƒ¼ćƒ«ę§‹ęˆć®ć¾ć¾č¼‰ć›ć¦ć„ć‚‹ć®ćÆć€ć”ę„›å¬Œā€¦ć€‚

Maven Compile Plugin悒ä½æ恆惑ć‚æćƒ¼ćƒ³ć€‚

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>vertx-codegen-redis-example</artifactId>
        <groupId>org.littlewings</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>my-smallrye-mutiny-vertx-redis-client</artifactId>

    <dependencies>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-redis-client</artifactId>
            <version>3.9.4</version>
        </dependency>

        <dependency>
            <groupId>io.smallrye.reactive</groupId>
            <artifactId>smallrye-mutiny-vertx-core</artifactId>
            <version>1.2.2</version>
        </dependency>

        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-codegen</artifactId>
            <classifier>processor</classifier>
            <version>3.9.4</version>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <includeGroupIds>io.vertx</includeGroupIds>
                    <includeArtifactIds>vertx-redis-client</includeArtifactIds>
                    <classifier>sources</classifier>
                    <includeTypes>jar</includeTypes>
                </configuration>
                <executions>
                    <execution>
                        <id>unpack-java</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includes>io/vertx/**/*.java</includes>
                            <excludes>**/impl/**/*.java</excludes>
                            <outputDirectory>${project.build.directory}/sources/java</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/sources/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <useIncrementalCompilation>false</useIncrementalCompilation>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-mutiny-source</id>
                        <configuration>
                            <annotationProcessors>
                                <annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
                            </annotationProcessors>
                            <compilerArgs>
                                <arg>-Acodegen.generators=mutiny</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

Maven Processor Plugin悒ä½æć†å “åˆć€‚

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>vertx-codegen-redis-example</artifactId>
        <groupId>org.littlewings</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>my-smallrye-mutiny-vertx-redis-client</artifactId>

    <dependencies>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-redis-client</artifactId>
            <version>3.9.4</version>
        </dependency>

        <dependency>
            <groupId>io.smallrye.reactive</groupId>
            <artifactId>smallrye-mutiny-vertx-core</artifactId>
            <version>1.2.2</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <includeGroupIds>io.vertx</includeGroupIds>
                    <includeArtifactIds>vertx-redis-client</includeArtifactIds>
                    <classifier>sources</classifier>
                    <includeTypes>jar</includeTypes>
                </configuration>
                <executions>
                    <execution>
                        <id>unpack-java</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includes>io/vertx/**/*.java</includes>
                            <excludes>**/impl/**/*.java</excludes>
                            <outputDirectory>${project.build.directory}/sources/java</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>4.4-jdk8</version>
                <configuration>
                    <systemProperties>
                        <java.util.logging.SimpleFormatter.format>%4$s: %3$s - %5$s %6$s%n</java.util.logging.SimpleFormatter.format>
                        <mvel2.disable.jit>true</mvel2.disable.jit>
                    </systemProperties>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceDirectory>${project.build.directory}/sources/java</sourceDirectory>
                            <processors>
                                <processor>io.vertx.codegen.CodeGenProcessor</processor>
                            </processors>
                            <optionMap>
                                <codegen.generators>mutiny</codegen.generators>
                            </optionMap>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

Maven Shade Plugin恮Resource Transformerć‚’ć”ć‚ƒć‚“ćØ見悋

恓悌ćÆ态ćŖć«ć‚’ć—ćŸćć¦ę›øć„ćŸć‚‚ć®ļ¼Ÿ

Maven Shade Plugin悒ä½æ恆ćØć€ä¾å­˜é–¢äæ‚ć‚’å«ć‚ćŸć‚¢ćƒ¼ćƒ†ć‚£ćƒ•ć‚”ć‚Æ惈悒Uber JARć«ćƒ‘ćƒƒć‚±ćƒ¼ć‚øćƒ³ć‚°ć™ć‚‹ć“ćØćŒć§ćć¾ć™ć€‚

恧态čØ­å®šć™ć‚‹ę™‚ć«Resource Transformer悒ćŖ悓ćØćŖ恏ä½æć£ć¦ć„ćŸć®ć§ć€ä»Šå›žć”ć‚ƒć‚“ćØ見恦ćæ悈恆恋ćŖ恁ćØ恄恆갗恫ćŖć‚Šć¾ć—ć¦ć€‚

Resource Transformerļ¼Ÿ

Resource TransformerćØćÆć€č¤‡ę•°ć®ć‚¢ćƒ¼ćƒ†ć‚£ćƒ•ć‚”ć‚Æćƒˆć‚„ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖ悒集ē“„ć™ć‚‹éš›ć«ć€é‡č¤‡ć™ć‚‹ćƒŖć‚½ćƒ¼ć‚¹ć‚’ćƒžćƒ¼ć‚øć™ć‚‹ćŸć‚ć®
ę–¹ę³•ć‚’ęä¾›ć™ć‚‹ć‚‚ć®ć§ć™ć€‚

äø€č¦§ćÆć“ć“ć«č¼‰ć£ć¦ć„ć¾ć™ć€‚

Apache Maven Shade Plugin – Resource Transformers

ć–ć£ćØč¼‰ć›ć‚‹ćØ态恓悓ćŖꄟ恘恧恙恭怂

ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰č‡Ŗ体ćÆć€ć“ć”ć‚‰ć«ć‚ć‚Šć¾ć™ć€‚

https://github.com/apache/maven-shade-plugin/tree/maven-shade-plugin-3.2.4/src/main/java/org/apache/maven/plugins/shade/resource

https://github.com/apache/maven-shade-plugin/tree/maven-shade-plugin-3.2.4/src/main/java/org/apache/maven/plugins/shade/resource/properties

ćØć¾ć‚ć€čŖ¬ę˜Žć‚’čŖ­ć‚“恧恄悋ćØ恩悓ćŖ恓ćØ恌恧恍恝恆ćŖć®ć‹é›°å›²ę°—ćÆć‚ć‹ć‚‹ć®ć§ć™ćŒć€å°‘ć—ćÆä½æć£ć¦ćæć¾ć—ć‚‡ć†ć‹ć€‚

ćŠé”Œ

ć“ć”ć‚‰ć®ćƒć‚æ悒굁ē”Ø恗恦态Maven Shade Plugin悒ä½æć£ć¦Uber JARć‚’ä½œć‚ć†ćØę€ć„ć¾ć™ć€‚

RESTEasy+Vert.x(Handler)で遊ぶ - CLOVER🍀

ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ć®å†…å®¹ćÆć€ć‚‚ć†ć”ć‚‡ć£ćØć‚·ćƒ³ćƒ—ćƒ«ć«ć—ć¾ć™ć€‚

恓恮Ꙃ恫态Resource Transformer悒恄恏恤恋ä½æć£ć¦ćæć¾ć—ć‚‡ć†ć€‚

ē’°å¢ƒ

ä»Šå›žć®ē’°å¢ƒćÆ态恓恔悉怂

$ java --version
openjdk 11.0.9.1 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)


$ mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: $HOME/.sdkman/candidates/maven/current
Java version: 11.0.9.1, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: ja_JP, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-54-generic", arch: "amd64", family: "unix"

ęŗ–å‚™

Maven依存関äæ‚ćÆ态恓悌恠恑čØ­å®šć€‚

    <dependencies>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-vertx</artifactId>
            <version>4.5.8.Final</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-reactor</artifactId>
            <version>4.5.8.Final</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jackson2-provider</artifactId>
            <version>4.5.8.Final</version>
        </dependency>

        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
            <version>3.9.4</version>
        </dependency>
        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-core</artifactId>
            <version>3.4.0</version>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0.SP1</version>
        </dependency>
    </dependencies>

ć‚½ćƒ¼ć‚¹ć‚³ćƒ¼ćƒ‰ćÆć“ć”ć‚‰ć€‚ć”ć‚‡ć£ćØå¼·å¼•ć«ć€Jackson 2ćØReactor悒ä½æć„ć¾ć™ć€‚

src/main/java/org/littlewings/maven/shade/App.java

package org.littlewings.maven.shade;

import io.vertx.core.Vertx;
import io.vertx.core.http.HttpServer;
import org.jboss.logging.Logger;
import org.jboss.resteasy.plugins.server.vertx.VertxRequestHandler;
import org.jboss.resteasy.plugins.server.vertx.VertxResteasyDeployment;
import org.jboss.resteasy.spi.ResteasyDeployment;

public class App {
    public static void main(String... args) {
        Logger logger = Logger.getLogger(App.class);

        Vertx vertx = Vertx.vertx();
        HttpServer server = vertx.createHttpServer();

        ResteasyDeployment deployment = new VertxResteasyDeployment();
        deployment.start();
        deployment.getRegistry().addPerRequestResource(EchoResource.class);

        server.requestHandler(new VertxRequestHandler(vertx, deployment));

        int port = 8080;
        server.listen(port);

        logger.infof("startup, server[%d]", port);
    }
}

src/main/java/org/littlewings/maven/shade/EchoResource.java

package org.littlewings.maven.shade;

import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import reactor.core.publisher.Mono;

@Path("echo")
public class EchoResource {
    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Mono<MessageResponse> echo(MessageRequest request) {
        String message = request.getMessage();

        String responseMessage = String.format("reply: %s", message);

        return Mono.just(new MessageResponse(responseMessage));
    }


    public static class MessageRequest {
        String message;

        public String getMessage() {
            return message;
        }
    }

    public static class MessageResponse {
        String message;

        public MessageResponse(String message) {
            this.message = message;
        }

        public String getMessage() {
            return message;
        }
    }
}

čµ·å‹•ć€‚

$ mvn compile exec:java -Dexec.mainClass=org.littlewings.maven.shade.App

動作ē¢ŗčŖć€‚

$ curl -i -H 'Content-Type: application/json' localhost:8080/echo -d '{"message": "Hello World!!"}'
HTTP/1.1 200 OK
transfer-encoding: chunked
Content-Type: application/json

{"message":"reply: Hello World!!"}

ć“ć®ć‚¢ćƒ—ćƒŖć‚±ćƒ¼ć‚·ćƒ§ćƒ³ć‚’ć€Maven Shade Plugin恧Uber JARć«ć—ć¦ć„ćć¾ć™ć€‚

Maven Shade Plugin悒čØ­å®šć™ć‚‹

ćŖ恫ćÆćØ悂恂悌ćØ恄恆恓ćØ恧态Maven Shade Pluginć‚’ć¾ćšćÆčØ­å®šć—ć¾ć™ć€‚

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                </configuration>
            </plugin>
        </plugins>
    </build>

ćƒ‘ćƒƒć‚±ćƒ¼ć‚øćƒ³ć‚°ć—ć¾ć™ć€‚

$ mvn package

恙悋ćØ态targetćƒ‡ć‚£ćƒ¬ć‚Æ惈ćƒŖ配äø‹ć«ē”Ÿęˆć•ć‚Œć‚‹JARćƒ•ć‚”ć‚¤ćƒ«ćŒć€Uber JAR恫ćŖć‚Šć¾ć™ć€‚

$ ll -h target/maven-shade-plugin-example-0.1.jar 
-rw-rw-r-- 1 xxxxx xxxxx 14M 11꜈ 22 23:04 target/maven-shade-plugin-example-0.1.jar

čµ·å‹•ć«ćÆ态mainćƒ”ć‚½ćƒƒćƒ‰ć‚’ęŒć£ćŸć‚Æćƒ©ć‚¹ć®ęŒ‡å®šćŒåæ…要恧恙怂

$ java -cp target/maven-shade-plugin-example-0.1.jar org.littlewings.maven.shade.App
11꜈ 22, 2020 11:05:55 午後 org.littlewings.maven.shade.App main
INFO: startup, server[8080]

実ćÆ态ć‚ŖćƒŖć‚øćƒŠćƒ«ć®JARćƒ•ć‚”ć‚¤ćƒ«ć‚’ē½®ćę›ćˆć‚‹ć‚ˆć†ć«ćƒ”ćƒƒć‚»ćƒ¼ć‚ø恌å‡ŗ恦恄悋恮恧

[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /path/to/target/maven-shade-plugin-example-0.1.jar with /path/to/target/maven-shade-plugin-example-0.1-shaded.jar

ć‚ŖćƒŖć‚øćƒŠćƒ«ć®JARćƒ•ć‚”ć‚¤ćƒ«ć‚’ę®‹ć™ć‚ˆć†ć«ć—ć¦ćæć¾ć—ć‚‡ć†ć‹ć€‚

configuration恧态shadedArtifactAttached悒trueć«ęŒ‡å®šć—ć¾ć™ć€‚

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                </configuration>
            </plugin>

ćƒ‘ćƒƒć‚±ćƒ¼ć‚øćƒ³ć‚°ć€‚

$ mvn clean package

恓恆恙悋ćØ态ć‚ŖćƒŖć‚øćƒŠćƒ«ć®JARćƒ•ć‚”ć‚¤ćƒ«ćŒę®‹ć‚Šć€Maven Shade Pluginć«ć‚ˆć‚‹Uber JARćÆshaded classierćŒä»˜ć„ćŸēŠ¶ę…‹ć§
ä½œęˆć•ć‚Œć¾ć™ć€‚

$ ll target/*.jar
-rw-rw-r-- 1 xxxxx xxxxx 13668491 11꜈ 22 23:07 target/maven-shade-plugin-example-0.1-shaded.jar
-rw-rw-r-- 1 xxxxx xxxxx     5395 11꜈ 22 23:07 target/maven-shade-plugin-example-0.1.jar

恓恮shadedćØ恄恆恮ćÆ态shadedClassifierNameć§å¤‰ę›“åÆčƒ½ć§ć™ć€‚

                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <shadedClassifierName>uber-jar</shadedClassifierName>
                </configuration>

ē”Ÿęˆć•ć‚Œć‚‹åå‰ć«ć¤ć„恦ćÆ态outputFile态shadedArtifactId态finalNamećŖ恩čح定åÆčƒ½ćŖć‚‚ć®ćŒć„ćć¤ć‹ć‚ć‚‹ć®ć§ć€č©³ć—ććÆ
shade:shadeć‚“ćƒ¼ćƒ«ć®ćƒ‰ć‚­ćƒ„ćƒ”ćƒ³ćƒˆć‚’å‚ē…§ć€‚

Apache Maven Shade Plugin – shade:shade

仄降ćÆ态仄äø‹ć®ēŠ¶ę…‹ć‹ć‚‰configuration恮äø­ć‚’å¤‰ę›“ć—ć¦ć„ćć¾ć™ć€‚

                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                </configuration>

ManifestResourceTransformer恧MANIFEST恮čØ­å®šć‚’č”Œć†

ęœ€åˆć«ć€mainć‚Æćƒ©ć‚¹ć‚’ęŒ‡å®šć—ć¦ć„ćŸć®ć‚’ćŖ悓ćØć‹ć—ć¾ć—ć‚‡ć†ć€‚ManifestResourceTransformer悒ä½æē”Øć—ć¾ć™ć€‚

Setting Manifest Entries with the ManifestResourceTransformer

ć“ć”ć‚‰ć«ć‚‚ć€ć»ć¼åŒē­‰ć®ć“ćØ恌ę›øć‹ć‚Œć¦ć„ć¾ć™ć€‚

Apache Maven Shade Plugin – Executable JAR

恓悓ćŖꄟ恘恧怂

                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <manifestEntries>
                                <Main-Class>org.littlewings.maven.shade.App</Main-Class>
                            </manifestEntries>
                        </transformer>
                    </transformers>
                </configuration>

恓悌恧态Main-Classć‚’ęŒ‡å®šć™ć‚‹ćØMETA-INF/MANIFEST.MFć«ęŒ‡å®šć—ćŸć‚Æćƒ©ć‚¹ćŒčØ­å®šć•ć‚Œć¾ć™ć€‚

MANIFEST.MF恮äø­čŗ«ć‚’ē¢ŗčŖć€‚

$ unzip -p target/maven-shade-plugin-example-0.1-shaded.jar META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven 3.6.3
Built-By: kazuhira
Build-Jdk: 11.0.9.1
Main-Class: org.littlewings.maven.shade.App

ćƒ‘ćƒƒć‚±ćƒ¼ć‚øćƒ³ć‚°ć—ć¦čµ·å‹•ē¢ŗčŖć€‚

$ java -jar target/maven-shade-plugin-example-0.1-shaded.jar 
11꜈ 22, 2020 11:25:22 午後 org.littlewings.maven.shade.App main
INFO: startup, server[8080]

java -jarć§čµ·å‹•ć§ćć‚‹ć‚ˆć†ć«ćŖć‚Šć¾ć—ćŸć€‚

ServicesResourceTransformer悒ä½æć£ć¦ć€META-INF/services恮äø­čŗ«ć‚’ćƒžćƒ¼ć‚ø恙悋

ćØ恓悍恧态ē¾ēŠ¶ć ćØJARćƒ•ć‚”ć‚¤ćƒ«ć‚’å®Ÿč”Œć—ć¦ć‚‚ć†ć¾ćå‹•ćć¾ć›ć‚“ć€‚

$ curl -i -H 'Content-Type: application/json' localhost:8080/echo -d '{"message": "Hello World!!"}'
HTTP/1.1 415 Unsupported Media Type
transfer-encoding: chunked

Content-Type恫åƾåæœć—ćŸMessageBodyReader恌ćŖ恄ćØčØ€ć£ć¦ć„ć¾ć™ć€‚

11꜈ 22, 2020 11:26:56 午後 org.jboss.resteasy.core.ExceptionHandler handleWebApplicationException
ERROR: RESTEASY002010: Failed to execute
javax.ws.rs.NotSupportedException: RESTEASY003200: Could not find message body reader for type: class org.littlewings.maven.shade.EchoResource$MessageRequest of content type: application/json
    at org.jboss.resteasy.core.interception.jaxrs.ServerReaderInterceptorContext.throwReaderNotFound(ServerReaderInterceptorContext.java:55)
    at org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.getReader(AbstractReaderInterceptorContext.java:133)
    at org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:75)

ćƒ‘ćƒƒć‚±ćƒ¼ć‚øćƒ³ć‚°ć™ć‚‹ę™‚ć«å®ŸćÆ恓悓ćŖę„Ÿć˜ć§å¤§é‡ć«WARNING恌å‡ŗåŠ›ć•ć‚Œć¦ć„ć¦ć€Uber JARć‚’ä½œć‚‹ćŸć‚ć«å„ć‚¢ćƒ¼ćƒ†ć‚£ćƒ•ć‚”ć‚Æ惈态
ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć‚’ć¾ćØć‚ć‚‹ę™‚ć«ćƒ•ć‚”ć‚¤ćƒ«ćŒé‡č¤‡ć—ć¦ć„ć‚‹ć‚‚ć®ćŒć‚ć‚‹ćØčØ€ć£ć¦ć„ć¾ć™ć€‚

[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] asyncutil-0.1.0.jar, btf-1.3.jar, cdi-api-2.0.SP1.jar, commons-codec-1.13.jar, commons-io-2.5.jar, commons-logging-1.2.jar, httpclient-4.5.12.jar, httpcore-4.4.13.jar, istack-commons-runtime-3.0.10.jar, jackson-annotations-2.11.1.jar, jackson-core-2.11.1.jar, jackson-coreutils-2.0.jar, jackson-databind-2.11.1.jar, jackson-jaxrs-base-2.11.1.jar, jackson-jaxrs-json-provider-2.11.1.jar, jackson-module-jaxb-annotations-2.11.1.jar, jakarta.activation-1.2.1.jar, jakarta.activation-api-1.2.1.jar, jakarta.validation-api-2.0.2.jar, javax.el-api-3.0.0.jar, javax.interceptor-api-1.2.jar, jaxb-runtime-2.3.3-b02.jar, jboss-annotations-api_1.3_spec-2.0.1.Final.jar, jboss-jaxb-api_2.3_spec-1.0.1.Final.jar, jboss-jaxrs-api_2.1_spec-2.0.1.Final.jar, jboss-logging-3.3.2.Final.jar, json-patch-1.13.jar, maven-shade-plugin-example-0.1.jar, microprofile-config-api-1.4.jar, microprofile-context-propagation-api-1.0-RC1.jar, msg-simple-1.2.jar, netty-buffer-4.1.49.Final.jar, netty-codec-4.1.49.Final.jar, netty-codec-dns-4.1.49.Final.jar, netty-codec-http-4.1.49.Final.jar, netty-codec-http2-4.1.49.Final.jar, netty-codec-socks-4.1.49.Final.jar, netty-common-4.1.49.Final.jar, netty-handler-4.1.49.Final.jar, netty-handler-proxy-4.1.49.Final.jar, netty-resolver-4.1.49.Final.jar, netty-resolver-dns-4.1.49.Final.jar, netty-transport-4.1.49.Final.jar, reactive-streams-1.0.3.jar, reactor-core-3.4.0.jar, resteasy-client-4.5.8.Final.jar, resteasy-client-api-4.5.8.Final.jar, resteasy-context-propagation-4.5.8.Final.jar, resteasy-core-4.5.8.Final.jar, resteasy-core-spi-4.5.8.Final.jar, resteasy-jackson2-provider-4.5.8.Final.jar, resteasy-jaxb-provider-4.5.8.Final.jar, resteasy-reactor-4.5.8.Final.jar, resteasy-vertx-4.5.8.Final.jar, smallrye-config-1.6.1.jar, smallrye-config-common-1.6.1.jar, smallrye-context-propagation-1.0.1.jar, smallrye-context-propagation-api-1.0.1.jar, txw2-2.3.3-b02.jar, vertx-core-3.9.4.jar define 1 overlapping resource: 
[WARNING]   - META-INF/MANIFEST.MF
[WARNING] istack-commons-runtime-3.0.10.jar, jakarta.activation-1.2.1.jar, jakarta.activation-api-1.2.1.jar, jaxb-runtime-2.3.3-b02.jar, jboss-annotations-api_1.3_spec-2.0.1.Final.jar, jboss-jaxrs-api_2.1_spec-2.0.1.Final.jar, txw2-2.3.3-b02.jar define 2 overlapping resources: 
[WARNING]   - META-INF/LICENSE.md
[WARNING]   - META-INF/NOTICE.md
[WARNING] cdi-api-2.0.SP1.jar, commons-codec-1.13.jar, commons-io-2.5.jar, commons-logging-1.2.jar, javax.el-api-3.0.0.jar, javax.interceptor-api-1.2.jar, jboss-jaxb-api_2.3_spec-1.0.1.Final.jar, jboss-logging-3.3.2.Final.jar define 1 overlapping resource: 
[WARNING]   - META-INF/LICENSE.txt
[WARNING] btf-1.3.jar, httpclient-4.5.12.jar, httpcore-4.4.13.jar, jackson-annotations-2.11.1.jar, jackson-core-2.11.1.jar, jackson-coreutils-2.0.jar, jackson-databind-2.11.1.jar, jackson-jaxrs-base-2.11.1.jar, jackson-jaxrs-json-provider-2.11.1.jar, jackson-module-jaxb-annotations-2.11.1.jar, jboss-jaxb-api_2.3_spec-1.0.1.Final.jar, json-patch-1.13.jar, microprofile-config-api-1.4.jar, msg-simple-1.2.jar define 1 overlapping resource: 
[WARNING]   - META-INF/LICENSE
[WARNING] jakarta.activation-1.2.1.jar, jakarta.activation-api-1.2.1.jar define 31 overlapping classes: 
[WARNING]   - javax.activation.ActivationDataFlavor
[WARNING]   - javax.activation.CommandInfo
[WARNING]   - javax.activation.CommandInfo$Beans
[WARNING]   - javax.activation.CommandInfo$Beans$1
[WARNING]   - javax.activation.CommandMap
[WARNING]   - javax.activation.CommandObject
[WARNING]   - javax.activation.DataContentHandler
[WARNING]   - javax.activation.DataContentHandlerFactory
[WARNING]   - javax.activation.DataHandler
[WARNING]   - javax.activation.DataHandler$1
[WARNING]   - 21 more...
[WARNING] resteasy-client-4.5.8.Final.jar, resteasy-context-propagation-4.5.8.Final.jar, resteasy-core-4.5.8.Final.jar, resteasy-jackson2-provider-4.5.8.Final.jar, resteasy-jaxb-provider-4.5.8.Final.jar, resteasy-reactor-4.5.8.Final.jar define 1 overlapping resource: 
[WARNING]   - META-INF/services/javax.ws.rs.ext.Providers
[WARNING] httpclient-4.5.12.jar, httpcore-4.4.13.jar, jackson-core-2.11.1.jar, jackson-databind-2.11.1.jar, jackson-jaxrs-json-provider-2.11.1.jar, jackson-module-jaxb-annotations-2.11.1.jar, microprofile-config-api-1.4.jar define 1 overlapping resource: 
[WARNING]   - META-INF/NOTICE
[WARNING] httpclient-4.5.12.jar, httpcore-4.4.13.jar define 1 overlapping resource: 
[WARNING]   - META-INF/DEPENDENCIES
[WARNING] commons-codec-1.13.jar, commons-io-2.5.jar, commons-logging-1.2.jar define 1 overlapping resource: 
[WARNING]   - META-INF/NOTICE.txt
[WARNING] btf-1.3.jar, jackson-coreutils-2.0.jar, json-patch-1.13.jar, msg-simple-1.2.jar define 2 overlapping resources: 
[WARNING]   - META-INF/ASL-2.0.txt
[WARNING]   - META-INF/LGPL-3.0.txt
[WARNING] netty-common-4.1.49.Final.jar, reactor-core-3.4.0.jar define 1 overlapping resource: 
[WARNING]   - META-INF/services/reactor.blockhound.integration.BlockHoundIntegration
[WARNING] netty-buffer-4.1.49.Final.jar, netty-codec-4.1.49.Final.jar, netty-codec-dns-4.1.49.Final.jar, netty-codec-http-4.1.49.Final.jar, netty-codec-http2-4.1.49.Final.jar, netty-codec-socks-4.1.49.Final.jar, netty-common-4.1.49.Final.jar, netty-handler-4.1.49.Final.jar, netty-handler-proxy-4.1.49.Final.jar, netty-resolver-4.1.49.Final.jar, netty-resolver-dns-4.1.49.Final.jar, netty-transport-4.1.49.Final.jar define 1 overlapping resource: 
[WARNING]   - META-INF/io.netty.versions.properties
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/

ć§ć€ä»Šå›žćÆē‰¹ć«ć“ć‚ŒćŒå•é”Œć«ćŖć£ć¦ć„ć¾ć™ć­ć€‚

[WARNING] resteasy-client-4.5.8.Final.jar, resteasy-context-propagation-4.5.8.Final.jar, resteasy-core-4.5.8.Final.jar, resteasy-jackson2-provider-4.5.8.Final.jar, resteasy-jaxb-provider-4.5.8.Final.jar, resteasy-reactor-4.5.8.Final.jar define 1 overlapping resource: 
[WARNING]   - META-INF/services/javax.ws.rs.ext.Providers

ćƒžćƒ¼ć‚ø後ćÆ恩恆ćŖć£ć¦ć„ć‚‹ć‚“ć§ć—ć‚‡ć†ļ¼Ÿ

$ unzip -p target/maven-shade-plugin-example-0.1-shaded.jar META-INF/services/javax.ws.rs.ext.Providers
org.jboss.resteasy.client.jaxrs.internal.CompletionStageRxInvokerProvider

ć²ćØć¤ć ć‘ę®‹ć£ć¦ć„ć¾ć™ā€¦ć€‚

恓恓恧态ServicesResourceTransformer悒ä½æć„ć¾ć™ć€‚

Concatenating Service Entries with the ServicesResourceTransformer

                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <manifestEntries>
                                <Main-Class>org.littlewings.maven.shade.App</Main-Class>
                            </manifestEntries>
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                    </transformers>
                </configuration>

JARćƒ•ć‚”ć‚¤ćƒ«ć‚’å†åŗ¦ä½œęˆć—ć¦čµ·å‹•ć€‚

$ java -jar target/maven-shade-plugin-example-0.1-shaded.jar 
11꜈ 22, 2020 11:37:36 午後 org.littlewings.maven.shade.App main
INFO: startup, server[8080]

ē¢ŗčŖć€‚

$ curl -i -H 'Content-Type: application/json' localhost:8080/echo -d '{"message": "Hello World!!"}'
HTTP/1.1 200 OK
transfer-encoding: chunked
Content-Type: application/json

{"message":"reply: Hello World!!"}

今åŗ¦ćÆOK恧恗恟怂

ćƒžćƒ¼ć‚øå¾Œć®ćƒ•ć‚”ć‚¤ćƒ«ćÆ恩恆ćŖć£ćŸć‚“ć§ć—ć‚‡ć†ļ¼Ÿ

$ unzip -p target/maven-shade-plugin-example-0.1-shaded.jar META-INF/services/javax.ws.rs.ext.Providers
org.jboss.resteasy.client.jaxrs.internal.CompletionStageRxInvokerProvider
org.jboss.resteasy.plugins.providers.AsyncStreamingOutputProvider
org.jboss.resteasy.plugins.providers.DataSourceProvider
org.jboss.resteasy.plugins.providers.DocumentProvider
org.jboss.resteasy.plugins.providers.DefaultTextPlain
org.jboss.resteasy.plugins.providers.DefaultNumberWriter
org.jboss.resteasy.plugins.providers.DefaultBooleanWriter
org.jboss.resteasy.plugins.providers.StringTextStar
org.jboss.resteasy.plugins.providers.SourceProvider
org.jboss.resteasy.plugins.providers.InputStreamProvider
org.jboss.resteasy.plugins.providers.ReaderProvider
org.jboss.resteasy.plugins.providers.ByteArrayProvider
org.jboss.resteasy.plugins.providers.FormUrlEncodedProvider
org.jboss.resteasy.plugins.providers.JaxrsFormProvider
org.jboss.resteasy.plugins.providers.CompletionStageProvider
org.jboss.resteasy.plugins.providers.ReactiveStreamProvider
org.jboss.resteasy.plugins.providers.FileProvider
org.jboss.resteasy.plugins.providers.FileRangeWriter
org.jboss.resteasy.plugins.providers.StreamingOutputProvider
org.jboss.resteasy.plugins.providers.IIOImageProvider
org.jboss.resteasy.plugins.providers.MultiValuedParamConverterProvider
org.jboss.resteasy.plugins.interceptors.CacheControlFeature
org.jboss.resteasy.plugins.interceptors.ClientContentEncodingAnnotationFeature
org.jboss.resteasy.plugins.interceptors.ServerContentEncodingAnnotationFeature
org.jboss.resteasy.plugins.interceptors.MessageSanitizerContainerResponseFilter
org.jboss.resteasy.plugins.providers.sse.SseEventProvider
org.jboss.resteasy.plugins.providers.sse.SseEventSinkInterceptor

org.jboss.resteasy.reactor.MonoProvider
org.jboss.resteasy.reactor.MonoRxInvokerImpl
org.jboss.resteasy.reactor.MonoRxInvokerProvider
org.jboss.resteasy.reactor.FluxProvider
org.jboss.resteasy.reactor.FluxRxInvokerImpl
org.jboss.resteasy.reactor.FluxRxInvokerProvider
org.jboss.resteasy.context.ContextFeature
org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider
org.jboss.resteasy.plugins.providers.jackson.UnrecognizedPropertyExceptionHandler
org.jboss.resteasy.plugins.providers.jackson.PatchMethodFilter
org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlSeeAlsoProvider
org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlRootElementProvider
org.jboss.resteasy.plugins.providers.jaxb.JAXBElementProvider
org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlTypeProvider
org.jboss.resteasy.plugins.providers.jaxb.CollectionProvider
org.jboss.resteasy.plugins.providers.jaxb.MapProvider
org.jboss.resteasy.plugins.providers.jaxb.XmlJAXBContextFinder

ć‚ć”ć‚ƒćć”ć‚ƒå¢—ćˆć¾ć—ćŸā€¦ć€‚

PropertiesTransformerć§ćƒ—ćƒ­ćƒ‘ćƒ†ć‚£ćƒ•ć‚”ć‚¤ćƒ«ć‚’ćƒžćƒ¼ć‚ø恙悋

WARNING悒見恦恄悋ćØć€ćƒ—ćƒ­ćƒ‘ćƒ†ć‚£ćƒ•ć‚”ć‚¤ćƒ«ć‚‚é‡č¤‡ć—ć¦ć„ć‚‹ć‚ˆć†ć§ć™ć€‚

[WARNING] netty-buffer-4.1.49.Final.jar, netty-codec-4.1.49.Final.jar, netty-codec-dns-4.1.49.Final.jar, netty-codec-http-4.1.49.Final.jar, netty-codec-http2-4.1.49.Final.jar, netty-codec-socks-4.1.49.Final.jar, netty-common-4.1.49.Final.jar, netty-handler-4.1.49.Final.jar, netty-handler-proxy-4.1.49.Final.jar, netty-resolver-4.1.49.Final.jar, netty-resolver-dns-4.1.49.Final.jar, netty-transport-4.1.49.Final.jar define 1 overlapping resource: 
[WARNING]   - META-INF/io.netty.versions.properties

恓悌悒态PropertiesTransformer悒ä½æć£ć¦ćƒžćƒ¼ć‚ø恗恦ćæć¾ć—ć‚‡ć†ć€‚

Merging properties files with PropertiesTransformer

ē¾ę™‚ē‚¹ć§ć®äø­čŗ«ć‚’ē¢ŗčŖć€‚

$ unzip -p target/maven-shade-plugin-example-0.1-shaded.jar META-INF/io.netty.versions.properties
#Generated by netty-parent/pom.xml
#Wed, 22 Apr 2020 10:53:19 +0000

netty-common.version=4.1.49.Final
netty-common.buildDate=2020-04-22 10\:53\:19 +0000
netty-common.commitDate=2020-04-22 09\:57\:26 +0000
netty-common.shortCommitHash=d0ec961
netty-common.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-common.repoStatus=clean

PropertiesTransformer悒čØ­å®šć€‚

                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <manifestEntries>
                                <Main-Class>org.littlewings.maven.shade.App</Main-Class>
                            </manifestEntries>
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.properties.PropertiesTransformer">
                            <resource>META-INF/io.netty.versions.properties</resource>
                            <alreadyMergedKey>already_merged</alreadyMergedKey>
                        </transformer>
                    </transformers>
                </configuration>

ćƒ‘ćƒƒć‚±ćƒ¼ć‚øćƒ³ć‚°ć—ć¦ć€ćƒ—ćƒ­ćƒ‘ćƒ†ć‚£ćƒ•ć‚”ć‚¤ćƒ«ć®äø­čŗ«ć‚’ē¢ŗčŖć€‚

$ unzip -p target/maven-shade-plugin-example-0.1-shaded.jar META-INF/io.netty.versions.properties
# Merged by maven-shade-plugin (org.apache.maven.plugins.shade.resource.properties.PropertiesTransformer)
netty-buffer.buildDate=2020-04-22 10\:54\:59 +0000
netty-buffer.commitDate=2020-04-22 09\:57\:26 +0000
netty-buffer.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-buffer.repoStatus=clean
netty-buffer.shortCommitHash=d0ec961
netty-buffer.version=4.1.49.Final
netty-codec-dns.buildDate=2020-04-22 10\:59\:08 +0000
netty-codec-dns.commitDate=2020-04-22 09\:57\:26 +0000
netty-codec-dns.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-codec-dns.repoStatus=clean
netty-codec-dns.shortCommitHash=d0ec961
netty-codec-dns.version=4.1.49.Final
netty-codec-http.buildDate=2020-04-22 11\:04\:06 +0000
netty-codec-http.commitDate=2020-04-22 09\:57\:26 +0000
netty-codec-http.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-codec-http.repoStatus=clean
netty-codec-http.shortCommitHash=d0ec961
netty-codec-http.version=4.1.49.Final
netty-codec-http2.buildDate=2020-04-22 11\:04\:52 +0000
netty-codec-http2.commitDate=2020-04-22 09\:57\:26 +0000
netty-codec-http2.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-codec-http2.repoStatus=clean
netty-codec-http2.shortCommitHash=d0ec961
netty-codec-http2.version=4.1.49.Final
netty-codec-socks.buildDate=2020-04-22 11\:06\:56 +0000
netty-codec-socks.commitDate=2020-04-22 09\:57\:26 +0000
netty-codec-socks.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-codec-socks.repoStatus=clean
netty-codec-socks.shortCommitHash=d0ec961
netty-codec-socks.version=4.1.49.Final
netty-codec.buildDate=2020-04-22 10\:58\:33 +0000
netty-codec.commitDate=2020-04-22 09\:57\:26 +0000
netty-codec.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-codec.repoStatus=clean
netty-codec.shortCommitHash=d0ec961
netty-codec.version=4.1.49.Final
netty-common.buildDate=2020-04-22 10\:53\:19 +0000
netty-common.commitDate=2020-04-22 09\:57\:26 +0000
netty-common.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-common.repoStatus=clean
netty-common.shortCommitHash=d0ec961
netty-common.version=4.1.49.Final
netty-handler-proxy.buildDate=2020-04-22 11\:07\:55 +0000
netty-handler-proxy.commitDate=2020-04-22 09\:57\:26 +0000
netty-handler-proxy.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-handler-proxy.repoStatus=clean
netty-handler-proxy.shortCommitHash=d0ec961
netty-handler-proxy.version=4.1.49.Final
netty-handler.buildDate=2020-04-22 11\:00\:05 +0000
netty-handler.commitDate=2020-04-22 09\:57\:26 +0000
netty-handler.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-handler.repoStatus=clean
netty-handler.shortCommitHash=d0ec961
netty-handler.version=4.1.49.Final
netty-resolver-dns.buildDate=2020-04-22 11\:08\:26 +0000
netty-resolver-dns.commitDate=2020-04-22 09\:57\:26 +0000
netty-resolver-dns.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-resolver-dns.repoStatus=clean
netty-resolver-dns.shortCommitHash=d0ec961
netty-resolver-dns.version=4.1.49.Final
netty-resolver.buildDate=2020-04-22 10\:56\:46 +0000
netty-resolver.commitDate=2020-04-22 09\:57\:26 +0000
netty-resolver.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-resolver.repoStatus=clean
netty-resolver.shortCommitHash=d0ec961
netty-resolver.version=4.1.49.Final
netty-transport.buildDate=2020-04-22 10\:57\:08 +0000
netty-transport.commitDate=2020-04-22 09\:57\:26 +0000
netty-transport.longCommitHash=d0ec961cce19646519d6a0d59e7604b0eacd9bf2
netty-transport.repoStatus=clean
netty-transport.shortCommitHash=d0ec961
netty-transport.version=4.1.49.Final

ć‚ć”ć‚ƒćć”ć‚ƒå¢—ćˆć¾ć—ćŸā€¦ć€‚

ćƒ©ć‚¤ć‚»ćƒ³ć‚¹ć®ē “ę£„ć‚„NOTICEć®ćƒžćƒ¼ć‚ø

ęœ€å¾Œć«ć€ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć«å«ć¾ć‚Œć¦ć„ć‚‹LICENSEćŠć‚ˆć³LICENSE.txt悒ē “ę£„ć—ć¦

[WARNING] cdi-api-2.0.SP1.jar, commons-codec-1.13.jar, commons-io-2.5.jar, commons-logging-1.2.jar, javax.el-api-3.0.0.jar, javax.interceptor-api-1.2.jar, jboss-jaxb-api_2.3_spec-1.0.1.Final.jar, jboss-logging-3.3.2.Final.jar define 1 overlapping resource: 
[WARNING]   - META-INF/LICENSE.txt
[WARNING] btf-1.3.jar, httpclient-4.5.12.jar, httpcore-4.4.13.jar, jackson-annotations-2.11.1.jar, jackson-core-2.11.1.jar, jackson-coreutils-2.0.jar, jackson-databind-2.11.1.jar, jackson-jaxrs-base-2.11.1.jar, jackson-jaxrs-json-provider-2.11.1.jar, jackson-module-jaxb-annotations-2.11.1.jar, jboss-jaxb-api_2.3_spec-1.0.1.Final.jar, json-patch-1.13.jar, microprofile-config-api-1.4.jar, msg-simple-1.2.jar define 1 overlapping resource: 
[WARNING]   - META-INF/LICENSE

Preventing License Duplication with the ApacheLicenseResourceTransformer

NOTICEćƒ•ć‚”ć‚¤ćƒ«ć‚’ćƒžćƒ¼ć‚øć—ć¾ć™ć€‚

[WARNING] httpclient-4.5.12.jar, httpcore-4.4.13.jar, jackson-core-2.11.1.jar, jackson-databind-2.11.1.jar, jackson-jaxrs-json-provider-2.11.1.jar, jackson-module-jaxb-annotations-2.11.1.jar, microprofile-config-api-1.4.jar define 1 overlapping resource: 
[WARNING]   - META-INF/NOTICE
[WARNING] commons-codec-1.13.jar, commons-io-2.5.jar, commons-logging-1.2.jar define 1 overlapping resource: 
[WARNING]   - META-INF/NOTICE.txt

Aggregating Notices with the ApacheNoticeResourceTransformer

čØ­å®šć€‚

                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <manifestEntries>
                                <Main-Class>org.littlewings.maven.shade.App</Main-Class>
                            </manifestEntries>
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.properties.PropertiesTransformer">
                            <resource>META-INF/io.netty.versions.properties</resource>
                            <alreadyMergedKey>already_merged</alreadyMergedKey>
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer">
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
                            <addHeader>false</addHeader>
                        </transformer>
                    </transformers>
                </configuration>

恓悌恧态LICENSE.txtćŠć‚ˆć³LICENSEćƒ•ć‚”ć‚¤ćƒ«ćŒćŖ恏ćŖć‚Šć¾ć™ć€‚

$ unzip -l target/maven-shade-plugin-example-0.1-shaded.jar | grep LICENSE
    35084  2019-06-16 21:23   META-INF/LICENSE.md

.mdć®ę–¹ćŒę®‹ć£ć¦ć„ć¾ć™ćŒā€¦ć€‚

NOTICEćƒ•ć‚”ć‚¤ćƒ«ćÆć€ćƒžćƒ¼ć‚øć•ć‚Œć¾ć™ć€‚

$ unzip -p target/maven-shade-plugin-example-0.1-shaded.jar META-INF/NOTICE

Apache Commons IO
Copyright 2002-2016 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

=========================================================================
==  NOTICE file corresponding to section 4(d) of the Apache License,   ==
==  Version 2.0, in this case for Microprofile Config                  ==
=========================================================================

Portions of this software were originally based on the following:
* Apache DeltaSpike Config
  https://deltaspike.apache.org
  under Apache License, v2.0

SPDXVersion: SPDX-2.1
PackageName: Eclipse Microprofile
PackageHomePage: http://www.eclipse.org/microprofile
PackageLicenseDeclared: Apache-2.0

PackageCopyrightText: <text>
Mark Struberg struberg@apache.org,
Gerhard Petracek gpetracek@apache.org,
Romain Manni-Bucau rmannibucau@apache.org,
Ron Smeral rsmeral@apache.org,
Emily Jiang emijiang@uk.ibm.com,
Ondrej Mihalyi ondrej.mihalyi@gmail.com,
Gunnar Morling gunnar@hibernate.org
</text>

Apache HttpClient
Copyright 1999-2020 The Apache Software Foundation

Apache HttpCore
Copyright 2005-2020 The Apache Software Foundation

Apache Commons Logging
Copyright 2003-2014 The Apache Software Foundation

Apache Commons Codec
Copyright 2002-2019 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).

src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java
contains test data from http://aspell.net/test/orig/batch0.tab.
Copyright (C) 2002 Kevin Atkinson (kevina@gnu.org)

===============================================================================

The content of package org.apache.commons.codec.language.bm has been translated
from the original php source code available at http://stevemorse.org/phoneticinfo.htm
with permission from the original authors.
Original source copyright:
Copyright (c) 2008 Alexander Beider & Stephen P. Morse.

# Jackson JSON processor

Jackson is a high-performance, Free/Open Source JSON processing library.
It was originally written by Tatu Saloranta (tatu.saloranta@iki.fi), and has
been in development since 2007.
It is currently developed by a community of developers, as well as supported
commercially by FasterXML.com.

## Licensing

Jackson core and extension components may licensed under different licenses.
To find the details that apply to this artifact see the accompanying LICENSE file.
For more information, including possible other licensing options, contact
FasterXML.com (http://fasterxml.com).

## Credits

A list of contributors may be found from CREDITS file, which is included
in some artifacts (usually source distributions); but is always available
from the source code management (SCM) system project uses.

Jackson core and extension components may be licensed under different licenses.
To find the details that apply to this artifact see the accompanying LICENSE file.
For more information, including possible other licensing options, contact
FasterXML.com (http://fasterxml.com).

今回ćÆć€ć–ć£ćØ恓悓ćŖꄟ恘恧怂

ć¾ćØ悁

ć“ć‚Œć¾ć§Maven Shade Pluginć‚’ćć‚Œć»ć©ä½æć£ć¦ć„ćŖć‹ć£ćŸćØ恄恆恮ćØ态ä½æć£ć¦ć‚‚é›°å›²ę°—ć§ć‚³ćƒ”ćƒ¼ļ¼†ćƒšćƒ¼ć‚¹ćƒˆć—ć¦ć„ć¦ć‚ć¾ć‚Š
ć”ć‚ƒć‚“ćØ見恦恄ćŖć‹ć£ćŸć®ć§ć€ć“ć‚Œć‚’ę©Ÿć«č¦‹ć¦ćæć¦ć ć„ć¶é›°å›²ę°—ć‚ć‹ć£ćŸę°—ćŒć—ć¾ć™ć€‚

今後ćÆć€ć‚‚ć†ć”ć‚‡ć£ćØć”ć‚ƒć‚“ćØä½æć„ć¾ć—ć‚‡ć†ā€¦ć€‚

ęœ€å¾Œć«ć€ä»Šå›žć®Maven Shade Plugin恮čح定å…Øä½“ć‚’č¼‰ć›ć¦ćŠćć¾ć™ć€‚

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <manifestEntries>
                                <Main-Class>org.littlewings.maven.shade.App</Main-Class>
                            </manifestEntries>
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.properties.PropertiesTransformer">
                            <resource>META-INF/io.netty.versions.properties</resource>
                            <alreadyMergedKey>already_merged</alreadyMergedKey>
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer">
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
                            <addHeader>false</addHeader>
                        </transformer>
                    </transformers>
                </configuration>
            </plugin>