The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

JReleaser によるパッケージングとリリース

このガイドでは、JReleaser ツールを使ったCLIアプリケーションのパッケージングとリリースについて説明します。

1. 前提条件

このガイドを完成させるには、以下が必要です:

  • 約15分

  • IDE

  • JDK 17+がインストールされ、 JAVA_HOME が適切に設定されていること

  • Apache Maven 3.9.6

  • 使用したい場合は、 Quarkus CLI

  • ネイティブ実行可能ファイルをビルドしたい場合、MandrelまたはGraalVM(あるいはネイティブなコンテナビルドを使用する場合はDocker)をインストールし、 適切に設定していること

  • GitHubアカウントとGitHubパーソナルアクセストークン

2. プロジェクトのブートストラップ

まず,CLIアプリケーションを定義したプロジェクトが必要です。 PicoCLIエクステンションの使用をお勧めします。これは以下のコマンドで行うことができます。

コマンドラインインタフェース
quarkus create cli org.acme:app
cd app

Gradleプロジェクトを作成するには、 --gradle または --gradle-kotlin-dsl オプションを追加します。

Quarkus CLIのインストールと使用方法の詳細については、 Quarkus CLI ガイドを参照してください。

Maven
mvn io.quarkus.platform:quarkus-maven-plugin:3.9.4:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=app \
    -Dextensions='picocli'
cd app

Gradleプロジェクトを作成するには、 -DbuildTool=gradle または -DbuildTool=gradle-kotlin-dsl オプションを追加します。

このコマンドは、プロジェクトのファイル構造と最低限必要なファイルのセットを初期化します。

.
├── README.md
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
    └── main
        ├── docker
        │   ├── Dockerfile.jvm
        │   ├── Dockerfile.legacy-jar
        │   └── Dockerfile.native
        ├── java
        │   └── org
        │       └── acme
        │           └── GreetingCommand.java
        └── resources
            └── application.properties

また、このコマンドは pom.xml にpicocli エクステンションを設定します。

    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-picocli</artifactId>
    </dependency>

3. GitHub リリース用のプロジェクトの準備

この作業を続ける前に、プロジェクトをGitHubリポジトリでホストする必要があります。この作業は、GitHub アカウントにログインし、新しいリポジトリを作成して、新しく作成したソースをそのリポジトリに追加することで完了します。 main ブランチをデフォルトとして選択すると、規約を利用して pom.xml で設定を少なくすることが可能です。

また、作成したリポジトリにリリースを投稿するためには、GitHub パーソナルアクセストークンが必要です。 パーソナルアクセストークンの作成方法は、公式ドキュメントに従ってください。作成したトークンは、今後のために安全な場所に保管しておきましょう。次に、トークンを環境変数 JRELEASER_GITHUB_TOKEN として設定し、ツールに読み込ませる方法があります。あるいは、 .yml.toml.json.properties のいずれかのファイルを使用して、トークンを安全な場所に保存することもできます。デフォルトの場所は ~/.jreleaser/config[format] です。例えば、 .yml のフォーマットを使用した場合、このファイルは次のようになります。

~/.jreleaser/config.yml
JRELEASER_GITHUB_TOKEN: <github-token-value>

さてさて。すべてのソースを追加し、最初のコミットを作成します。コミットメッセージの規約は自由ですが、 Conventional Commits 仕様に従った方が、JReleaserをより効果的に使うことができます。最初のコミットでは、"build:Add initial sources" というメッセージで最初のコミットを行います。

4. ネイティブイメージでの配布

Quarkusは、GraalVM Native Imageを使用してネイティブ実行可能ファイルを作成する方法をすでに知っています。デフォルトの設定では、命名規則に従って1つの実行ファイルが作成されます。しかし、JReleaserツールは、ZipまたはTarファイルとしてパッケージ化された従来のファイル構造であるディストリビューションを期待しています。ファイル構造は以下のようなレイアウトになっている必要があります:

.
├── LICENSE
├── README
└── bin
    └── executable

この構造では、設定ファイル、シェル補完スクリプト、マンページ、ライセンス、Readmeなど、実行ファイルに必要なあらゆる種類のサポートファイルを追加することができます。

5. ディストリビューションの作成

maven-assembly-pluginを利用して、このようなディストリビューションを作成することができます。また、 os-maven-plugin を利用して、この実行ファイルが実行可能なプラットフォームを適切に識別し、ディストリビューションのファイル名にそのプラットフォームを追加します。

まず、 pom.xml に os-maven-plugin を追加しましょう。このプラグインは、Maven のエクステンションとして動作するため、ファイルの <build> セクションに追加する必要があります。

  <build>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.7.1</version>
      </extension>
    </extensions>
    <!-- ... -->

次に,Linux や macOS プラットフォーム上のネイティブ実行可能ファイルには通常拡張子がありませんが,Windows の実行ファイルには拡張子がありますので,生成された実行ファイルの名前を変更する際にはこの点に注意する必要があります.また,生成されたディストリビューションを独自のディレクトリに配置することで, target ディレクトリが散らかるのを防ぐことができます.そこで、 pom.xml の既存の <properties> セクションに、いくつかのプロパティを追加してみましょう。

<executable-suffix/>
<distribution.directory>${project.build.directory}/distributions</distribution.directory>

次に、maven-assembly-plugin を設定して、実行可能ファイルと、そのジョブを実行するために必要になる可能性のあるサポートファイルを含む Zip ファイルと Tar ファイルを作成します。ディストリビューションの名前に特に注意してください。ここで、os-maven-plugin によって検出されたプラットフォームのプロパティーを利用します。このプラグインは、package フェーズにバインドされた single ゴールを使用して独自のプロファイルで設定されます。これは、リリースの準備ができたときにのみ必要になるため、ビルドが呼び出されるたびにディストリビューションを再ビルドすることを回避するためにこのように行われます。

    <profile>
      <id>dist</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.3.0</version>
            <configuration>
              <attach>false</attach>
              <appendAssemblyId>false</appendAssemblyId>
              <finalName>${project.artifactId}-${project.version}-${os.detected.classifier}</finalName>
              <outputDirectory>${distribution.directory}</outputDirectory>
              <workDirectory>${project.build.directory}/assembly/work</workDirectory>
              <descriptors>
                <descriptor>src/main/assembly/assembly.xml</descriptor>
              </descriptors>
            </configuration>
            <executions>
              <execution>
                <id>make-distribution</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>dist-windows</id>
      <activation>
        <os>
          <family>windows</family>
        </os>
      </activation>
      <properties>
        <executable-suffix>.exe</executable-suffix>
      </properties>
    </profile>

2 つのプロファイルが設定されていることに注意してください。dist プロファイルはアセンブリプラグインを設定し、コマンドフラグとして -Pdist を渡すことによって明示的にアクティブ化する必要があるように設定されています。一方、ビルドが Windows プラットフォームで実行されると、dist-windows プロファイルが自動的にアクティブになります。この 2 番目のプロファイルは、次に示すように、アセンブリ記述子に必要な executable-suffix プロパティーの値の設定を処理します。

src/main/assembly/assembly.xml
<assembly
        xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
    <id>dist</id>
    <formats>
        <format>tar.gz</format>
        <format>zip</format>
        <format>dir</format>
    </formats>
    <files>
        <file>
            <source>${project.build.directory}/${project.artifactId}-${project.version}-runner${executable-suffix}</source>
            <outputDirectory>./bin</outputDirectory>
            <destName>${project.artifactId}${executable-suffix}</destName>
        </file>
    </files>
</assembly>

これらのファイルは、macOS上で ./mvnw -Pdist package を起動したときに、assembly プラグインによって作成されるファイルです。

$ tree target/distributions/
target/distributions/
├── app-1.0.0-SNAPSHOT-osx-x86_64
│   └── app-1.0.0-SNAPSHOT-osx-x86_64
│       └── bin
│           └── app
├── app-1.0.0-SNAPSHOT-osx-x86_64.tar.gz
└── app-1.0.0-SNAPSHOT-osx-x86_64.zip

アセンブリ記述子を自由に更新して、LICENSE、readme、または実行可能ファイルのコンシューマーが必要とするその他のファイルを追加してください。ここでビルド: ディストリビューションアセンブリの設定を使用して別のコミットを行います。

これで、次の段階であるリリースの設定に進むことができます。

6. JReleaser の追加

JReleaser ツールは、CLI ツール、Docker イメージ、または Maven プラグインなどのさまざまな方法で呼び出すことができます。最後のオプションは、すでに Maven を使用していることを考えると、非常に便利です。リリース設定を含むさらに別のプロファイルを追加しましょう。リリースを投稿する準備ができている場合にのみ、この動作を常にアクティブにする必要はありません。

    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jreleaser</groupId>
            <artifactId>jreleaser-maven-plugin</artifactId>
            <version>1.6.0</version>
          </plugin>
        </plugins>
      </build>
    </profile>

この時点で呼び出すことができるいくつかの目標があります。たとえば、./mvnw -Prelease jreleaser:config コマンドを呼び出すことにより、JReleaser に現在の設定を出力するように依頼できます。ツールは、プロジェクトについて知っているすべてのものを出力します。./mvnw -Prelease jreleaser:changelog を呼び出して変更ログを生成することもできます。変更ログを含むファイルは target/jreleaser/release/CHANGELOG.md に配置され、この時点では次のようになります。

target/jreleaser/release/CHANGELOG.md
## Changelog

8ef3307 build: Configure distribution assembly
5215200 build: Add initial sources

あまりエキサイティングではありません。しかし、JReleaser に独自の規約に従ってチェンジログをフォーマットするように指示することでこれを変更することが出来ます。パターンを手動で指定してコミットを分類できますが、規約に沿ったコミットに従うことを選択した場合は、JReleaser に同じことを行うように指示できます。JReleaser プラグイン設定セクションに以下を追加します:

            <configuration>
              <jreleaser>
                <release>
                  <github>
                    <changelog>
                      <formatted>ALWAYS</formatted>
                      <preset>conventional-commits</preset>
                    </changelog>
                  </github>
                </release>
              </jreleaser>
            </configuration>

前述のMavenコマンドをもう一度実行し、生成されたチェンジログを確認してください、以下のようになるはずです:

target/jreleaser/release/CHANGELOG.md
## Changelog

## 🛠  Build
- 8ef3307 Configure distribution assembly (Andres Almiray)
- 5215200 Add initial sources (Andres Almiray)


## Contributors
We'd like to thank the following people for their contributions:
Andres Almiray

適用できるフォーマットオプションは他にもありますが、今のところはこれらで十分です。ビルド: JReleaser プラグインの設定をコミットメッセージとして使用して、今すぐさらに別のコミットを行いましょう。必要に応じて、変更ログをもう一度生成して、この最新のコミットがファイルに追加されていることを確認できます。

7. リリースへのディストリビューションの追加

バイナリー配布を設定できるようになりました。./mvnw -Prelease jreleaser:config コマンドを実行すると、前の手順で設定した配布ファイルについての言及がないことに気付くでしょう。これは、ツールに暗黙の知識がないため、リリースするファイルを JReleaser に通知する必要があるためです。これにより、ファイルを自由に追加または削除したい場合に、ディストリビューションの作成がリリースアセットから切り離されます。この特定のケースでは、macOS と Windows の両方に Zip ファイルを設定し、Linux に Tar ファイルを設定します。これらのファイルは、次のように JReleaser プラグイン設定セクションに追加する必要があります。

            <configuration>
              <jreleaser>
                <release>
                  <github>
                    <changelog>
                      <formatted>ALWAYS</formatted>
                      <preset>conventional-commits</preset>
                    </changelog>
                  </github>
                </release>
                <distributions>
                  <app>
                    <type>BINARY</type>
                    <artifacts>
                      <artifact>
                        <path>${distribution.directory}/{{distributionName}}-{{projectVersion}}-linux-x86_64.tar.gz</path>
                        <platform>linux-x86_64</platform>
                      </artifact>
                      <artifact>
                        <path>${distribution.directory}/{{distributionName}}-{{projectVersion}}-windows-x86_64.zip</path>
                        <platform>windows-x86_64</platform>
                      </artifact>
                      <artifact>
                        <path>${distribution.directory}/{{distributionName}}-{{projectVersion}}-osx-x86_64.zip</path>
                        <platform>osx-x86_64</platform>
                      </artifact>
                    </artifacts>
                  </app>
                </distributions>
              </jreleaser>
            </configuration>

3 つの設定されたアーティファクトを持つ`app`(便宜上プロジェクトの artifactId と同じ) という名前のディストリビューションを評価できます。パスを定義するための Maven プロパティーと Mustache テンプレートの使用に注意してください。設定をパラメーター化するためにプロパティーが必要な場合、またはプロパティーに依存する場合は、明示的な値を使用できます。Maven プロパティーはビルドの検証中に即時に解決されますが、Mustache テンプレートは JReleaser プラグインの目標の実行中に遅延して解決されます。各アーティファクトは、それらを一意に識別する platform プロパティーを定義する必要があります。./mvnw -Prelease jreleaser:config を実行すると、プラグインがプロジェクトによって提供されるメタデータが増えることを期待する設定済みのディストリビューションがあるため、すぐにエラーが発生します。

[ERROR] == JReleaser ==
[ERROR] project.copyright must not be blank
[ERROR] project.description must not be blank
[ERROR] project.website must not be blank
[ERROR] project.docsUrl must not be blank
[ERROR] project.license must not be blank
[ERROR] project.authors must not be blank

このメタデータは、JReleaser プラグインの設定の一部として、または標準の POM 要素を使用して 2 つの方法で提供できます。前者のオプションを選択した場合、プラグインの設定は次のようになります。

            <configuration>
              <jreleaser>
                <project>
                 <description>app - Sample Quarkus CLI application</description>
                 <links>
                   <homepage><a href="https://github.com/aalmiray/app" class="bare">https://github.com/aalmiray/app</a></homepage>
                   <documentation><a href="https://github.com/aalmiray/app" class="bare">https://github.com/aalmiray/app</a></documentation>
                 </links>
                 <license>APACHE-2.0</license>
                 <authors>Andres Almiray</authors>
                 <copyright>2021 Kordamp</copyright>
                </project>
                <!-- ... -->

標準の POM 要素を使用することを選択した場合、pom.xml には少なくともこれらのエントリーが含まれている必要があります。もちろん、値を独自のものに適合させます。

  <name>app</name>
  <description>app -- Sample Quarkus CLI application</description>
  <inceptionYear>2021</inceptionYear>
  <url>https://github.com/aalmiray/app</url>
  <developers>
    <developer>
      <id>aalmiray</id>
      <name>Andres Almiray</name>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

それでも、./mvnw -Prelease jreleaser:config をもう一度呼び出すと、別のエラーが発生するため、まだトラブルを脱していません。今回の失敗は、アーティファクトの欠落に関連しています。これは、必要なすべてのアーティファクトをアセンブルしなかったためですが、プラグインはそれらがすぐに利用できることを期待しています。ここでは、他のノードで必要なアーティファクトをビルドし、それらを予想される場所にコピーすることを選択できます。これは、複数のノードで GitHub Actions ワークフローを実行できるタスクです。または、一部のアーティファクトを無視して、現在のプラットフォームに一致するアーティファクトのみを選択するように JReleaser に指示することもできます。macOS で作成したときにディストリビューションがどのように表示されるかを前述しましたが、そのプラットフォーム上にまだ正しいアーティファクトがあると仮定しています。

追加のフラグ ./mvnw-Prelease jreleaser:config -Djreleaser.select.current.platform を指定して jreleaser:config ゴールを呼び出すことにより、この時点で macOS に一致するアーティファクトのみを選択するように JReleaser に指示できます。今回はコマンドが成功し、モデルが出力されます。macOS アーティファクトのパスのみが完全に解決されており、他の 2 つのパスは変更されていないことに注意してください。

ここで、ビルド: 配布アーティファクトの設定をメッセージとしてもう 1 つコミットしてみましょう。別のゴール ./mvnw -Prelease jreleaser:release -Djreleaser.select.current.platform を呼び出すことで、今すぐリリースを作成できます。これにより、選択したリポジトリーに Git リリースが作成されます。これには、リポジトリーのタグ付け、変更ログのアップロード、すべての配布アーティファクト、およびそれらのチェックサムがリリースアセットとして含まれます。

しかし、その前に、もう 1 つの機能を追加して、macOS ユーザーがバイナリーディストリビューションを簡単に利用できるようにする Homebrew 式を作成しましょう。

8. パッケージャーとしての Homebrew の設定

Homebrew は、バイナリーをインストールおよび管理するための macOS ユーザーの間で人気のある選択肢です。Homebrew パッケージは、特定のバイナリーをインストールまたはアップグレードするためにターゲット環境で実行される Ruby ファイル (フォーミュラと呼ばれる) をコアにしています。JReleaser は、すでに設定したようなバイナリー分布から数式を作成できます。

これを機能させるには、次のように JReleaser プラグイン設定で Homebrew を有効にする必要があります。

                <distributions>
                  <app>
                    <type>BINARY</type>
                    <brew>
                      <active>ALWAYS</active>
                    </brew>
                    <artifacts>
                      <artifact>
                        <path>${distribution.directory}/{{distributionName}}-{{projectVersion}}-linux-x86_64.tar.gz</path>
                        <platform>linux-x86_64</platform>
                      </artifact>
                      <artifact>
                        <path>${distribution.directory}/{{distributionName}}-{{projectVersion}}-windows-x86_64.zip</path>
                        <platform>windows-x86_64</platform>
                      </artifact>
                      <artifact>
                        <path>${distribution.directory}/{{distributionName}}-{{projectVersion}}-osx-x86_64.zip</path>
                        <platform>osx-x86_64</platform>
                      </artifact>
                    </artifacts>
                  </app>
                </distributions>

最後に、スナップショットでないリリースの Homebrew 公式を公開するのは良い習慣なので、プロジェクトのバージョンを 1.0.0-SNAPSHOT から 1.0.0.Alpha1 に変更するか、あるいはそのまま 1.0.0 に変更します。最後のコミットで完了です。コミットメッセージは "feat: Add Homebrew packager configuration" です。さて、ついに準備が整いました。リリースをポストしましょう。

9. リリースの作成

これは pom.xml に設定を追加する慌ただしいツアーでしたが、これはプロジェクトの最初のリリースを準備するためのもので、それ以降のリリースでは設定に手を加える必要はありません。Git リリースと Homebrew 式を jreleaser:full-release というゴールで作成しますが、もしまだどうなるかわからないという場合は、ドライランモードでゴールを起動することができます。つまり、Git リポジトリなどのリモートリソースに影響を与えることなく、必要に応じてすべてのローカル操作を JReleaser に実行させます。以下のようになります。

# because we changed the project's version
./mvnw -Dnative,dist package
./mvnw -Prelease jreleaser:full-release -Djreleaser.select.current.platform -Djreleaser.dry.run=true

[INFO] --- jreleaser-maven-plugin:1.6.0:full-release (default-cli) @ app ---
[INFO] JReleaser 1.6.0
[INFO]   - basedir set to /tmp/app
[INFO]   - outputdir set to /tmp/app/target/jreleaser
[WARNING] Platform selection is in effect
[WARNING] Artifacts will be filtered by platform matching: [osx-x86_64]
[INFO] git-root-search set to false
[INFO] Loading variables from /Users/aalmiray/.jreleaser/config.toml
[INFO] Validating configuration
[INFO] Strict mode set to false
[INFO] Project version set to 1.0.0.Alpha1
[INFO] Release is not snapshot
[INFO] Timestamp is 2023-04-27T15:06:34.289907+02:00
[INFO] HEAD is at 73603ac
[INFO] Platform is osx-x86_64
[INFO] dry-run set to true
[INFO] Generating changelog
[INFO] Storing changelog: target/jreleaser/release/CHANGELOG.md
[INFO] Cataloging artifacts
[INFO]   [sbom] Cataloging is not enabled. Skipping
[INFO] Calculating checksums for distributions and files
[INFO]   [checksum] target/distributions/app-1.0.0.Alpha1-osx-x86_64.zip.sha256
[INFO] Signing distributions and files
[INFO]   [sign] Signing is not enabled. Skipping
[INFO] Deploying Maven artifacts
[INFO]   [maven] Deploying is not enabled. Skipping
[INFO] Uploading distributions and files
[INFO]   [upload] Uploading is not enabled. Skipping
[INFO] Releasing to https://github.com/aalmiray/app@main
[INFO]  - uploading app-1.0.0.Alpha1-osx-x86_64.zip
[INFO]  - uploading checksums_sha256.txt
[INFO] Preparing distributions
[INFO]   - Preparing app distribution
[INFO]     [brew] preparing app distribution
[INFO] Packaging distributions
[INFO]   - Packaging app distribution
[INFO]     [brew] packaging app distribution
[INFO] Publishing distributions
[INFO]   - Publishing app distribution
[INFO]     [brew] publishing app distribution
[INFO]     [brew] setting up repository aalmiray/homebrew-tap
[INFO] Announcing release
[INFO]   [announce] Announcing is not enabled. Skipping
[INFO] Writing output properties to target/jreleaser/output.properties
[INFO] JReleaser succeeded after 0.620 s

JReleaserが以下の作業を代行します。

  • 最後のタグ(もしあれば)から最新のコミットまでのすべてのコミットを基にして、チェンジログを生成します。

  • すべての入力ファイルに対してSHA256(デフォルト)のチェックサムを計算します。

  • すべてのファイルにGPGで署名します。ここでは、このステップを設定していないので、スキップされます。

  • JFrog ArtifactoryまたはAWS S3にアセットをアップロードします。このステップは設定しないのでこれも省略します。

  • 選択したリポジトリーに Git リリースを作成し、タグを付けます。

  • チェックサムを含むすべてのアセットをアップロードします。

  • Homebrew 公式を作成し、 https://github.com/aalmiray/homebrew-tap に公開します。

もちろん、 -Djreleaser.dry.run=true プロパティが有効だったので、リモートリポジトリは影響を受けませんでした。もし気になる場合は、公開するHomebrewの公式を定義している target/jreleaser/package/app/brew/Formula/app.rb の内容を確認してください。以下のようになるはずです:

app.rb
# Generated with JReleaser 1.6.0 at 2023-04-27T15:06:34.289907+02:00
class App < Formula
  desc "app -- Sample Quarkus CLI application"
  homepage "pass:[https://github.com/aalmiray/app]"
  url "pass:[https://github.com/aalmiray/app/releases/download/v1.0.0.Alpha1/app-1.0.0.Alpha1-osx-x86_64.zip]"
  version "1.0.0.Alpha1"
  sha256 "85c9918b23e3ac4ef64d5dd02714e241231d3f1358afdba09d3fd0b9a889e131"
  license "Apache-2.0"


  def install
    libexec.install Dir["*"]
    bin.install_symlink "#{libexec}/bin/app" => "app"
  end

  test do
    output = shell_output("#{bin}/app --version")
    assert_match "1.0.0.Alpha1", output
  end
end

準備ができたら、今度はコマンド ラインから -Djreleaser.dry.run フラグを削除して実際にリリースを作成し、リポジトリを参照して新しく作成されたリリースを確認します。

10. さらに詳しく

11. 参考

参考までに、 pom.xml の全内容は以下の通りです。

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.acme</groupId>
  <artifactId>app</artifactId>
  <version>1.0.0.Alpha1</version>
  <name>app</name>
  <description>app -- Sample Quarkus CLI application</description>
  <inceptionYear>2021</inceptionYear>
  <url>https://github.com/aalmiray/app</url>
  <developers>
    <developer>
      <id>aalmiray</id>
      <name>Andres Almiray</name>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <properties>
    <executable-suffix/>
    <distribution.directory>${project.build.directory}/distributions</distribution.directory>
    <compiler-plugin.version>3.12.1</compiler-plugin.version>
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
    <quarkus.platform.version>3.9.4</quarkus.platform.version>
    <surefire-plugin.version>3.0.0</surefire-plugin.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>${quarkus.platform.artifact-id}</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-picocli</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-arc</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-junit5</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.7.1</version>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <version>${quarkus.platform.version}</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
              <goal>generate-code</goal>
              <goal>generate-code-tests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler-plugin.version}</version>
        <configuration>
          <parameters>${maven.compiler.parameters}</parameters>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire-plugin.version}</version>
        <configuration>
          <systemPropertyVariables>
            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
            <maven.home>${maven.home}</maven.home>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>native</id>
      <activation>
        <property>
          <name>native</name>
        </property>
      </activation>
      <properties>
        <skipITs>false</skipITs>
        <quarkus.package.type>native</quarkus.package.type>
      </properties>
    </profile>
    <profile>
      <id>dist</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.3.0</version>
            <configuration>
              <attach>false</attach>
              <appendAssemblyId>false</appendAssemblyId>
              <finalName>${project.artifactId}-${project.version}-${os.detected.classifier}</finalName>
              <outputDirectory>${distribution.directory}</outputDirectory>
              <workDirectory>${project.build.directory}/assembly/work</workDirectory>
              <descriptors>
                <descriptor>src/main/assembly/assembly.xml</descriptor>
              </descriptors>
            </configuration>
            <executions>
              <execution>
                <id>make-distribution</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>dist-windows</id>
      <activation>
        <os>
          <family>windows</family>
        </os>
      </activation>
      <properties>
        <executable-suffix>.exe</executable-suffix>
      </properties>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jreleaser</groupId>
            <artifactId>jreleaser-maven-plugin</artifactId>
            <version>1.6.0</version>
            <configuration>
              <jreleaser>
                <!--project>
                 <description>app - Sample Quarkus CLI application</description>
                 <website>https://github.com/aalmiray/app</website>
                 <docsUrl>https://github.com/aalmiray/app</docsUrl>
                 <license>APACHE-2.0</license>
                 <authors>Andres Almiray</authors>
                 <copyright>2021 Kordamp</copyright>
                </project-->
                <release>
                  <github>
                    <changelog>
                      <formatted>ALWAYS</formatted>
                      <preset>conventional-commits</preset>
                    </changelog>
                  </github>
                </release>
                <distributions>
                  <app>
                    <type>BINARY</type>
                    <brew>
                      <active>ALWAYS</active>
                    </brew>
                    <artifacts>
                      <artifact>
                        <path>${distribution.directory}/{{distributionName}}-{{projectVersion}}-linux-x86_64.tar.gz</path>
                        <platform>linux-x86_64</platform>
                      </artifact>
                      <artifact>
                        <path>${distribution.directory}/{{distributionName}}-{{projectVersion}}-windows-x86_64.zip</path>
                        <platform>windows-x86_64</platform>
                      </artifact>
                      <artifact>
                        <path>${distribution.directory}/{{distributionName}}-{{projectVersion}}-osx-x86_64.zip</path>
                        <platform>osx-x86_64</platform>
                      </artifact>
                    </artifacts>
                  </app>
                </distributions>
              </jreleaser>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

関連コンテンツ