---
schema_version: "1"
id: 9f9609dab504ec879ad3170941b4d9bcb4e0a0c7b1a102922649d5b3b5526db9
title: "Mule 4 の概要: アプリケーションのパッケージ化"
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/mule-runtime/4.9/intro-packaging.md
canonical_url: https://docs.mulesoft.com/jp/mule-runtime/4.9/intro-packaging
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e55742581136a2782f574ffb536abeeeb255fc1afd570ccd768a3a29fc40fb94
description: MuleSoft Documentation Site
release: "4.9"
latest: false
---
# Mule 4 の概要: アプリケーションのパッケージ化

## [](#アプリケーションの構造)アプリケーションの構造

Mule 4 では、Mule アプリケーションのパッケージ化の方法にいくつかの重要な変更が行われています。Mule アプリケーションは JAR としてパッケージ化されるようになり、構造が異なります。Mule Maven プラグインを使用すると、ソースコードを簡単にこの構造にパッケージ化できます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 60%;">
<col style="width: 40%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">場所</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>META-INF/mule-artifact/mule-artifact.json</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Mule アプリケーションの記述子 (​<a href="#app_descriptor">アプリケーション記述子</a>​を参照)。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>META-INF/mule-src/yourapp/</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ソースコードの場所 (省略可能)。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>repository</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Maven レイアウトにあるアプリケーションのすべての連動関係のリポジトリ。アプリケーションのすべてのコネクタが含まれます。(例: <code>repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar</code>​)。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>yourapp.xml</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Mule の XML コード。</p></td>
</tr>
</tbody>
</table>

## [](#app_descriptor)アプリケーション記述子

Mule 4 のアプリケーションの ​`META-INF/mule-artifact/`​ に ​`mule-artifact.json`​ ファイルがあります。このファイルにアプリケーション、設定、必要な Mule バージョン、クラスローダー設定が説明されています。

```json
{
  "configs": [
    "ch-usage-sync.xml"
  ],
  "redeploymentEnabled": true,
  "name": "ch-usage-sync",
  "minMuleVersion": "4.0.0",
  "requiredProduct": "MULE_EE",
  "classLoaderModelLoaderDescriptor": {
    "id": "mule",
    "attributes": {
      "exportedResources": []
    }
  },
  "bundleDescriptorLoader": {
    "id": "mule",
    "attributes": {}
  }
}
```

### [](#アプリケーション記述子リファレンス)アプリケーション記述子リファレンス

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 60%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">属性</th>
<th class="tableblock halign-left valign-top">値のデータ型</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>configs</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Array of String (文字列の配列)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Mule の設定ファイルのセット。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>redeploymentEnabled</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Boolean (ブール)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">アプリケーション設定ファイルを変更すると再デプロイメントがトリガーされるかどうか。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String (文字列)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">アプリケーションのわかりやすい名前。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>minMuleVersion</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String (文字列)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">アプリケーションのデプロイに必要な Mule Runtime の最小バージョン。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>requiredProduct</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">String (文字列)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">アプリケーションのデプロイに必要な製品種別。  <code>MULE</code>​ は、アプリケーションを Community Edition (CE) バージョンまたは Enterprise Edition (EE) バージョンにデプロイできることを示します。  <code>MULE_EE</code>​ は、アプリケーションを EE バージョンにのみデプロイできることを示します。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>classLoaderModelLoaderDescriptor</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Object (オブジェクト)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">アプリケーションのクラスローディングモデルの記述子。​<code>id</code>​ 項目は、アプリケーションの連動関係とパッケージ/リソースの使用目的を理解するためにランタイムが使用するメカニズムを特定します。Mule はデフォルトで ​<code>mule</code>​ ID を使用します。つまり、アプリケーションからエクスポートされたパッケージとリソースが ​<code>attributes</code>​ 項目で説明され、連動関係は ​<code>/META-INF/mule-artifact/classloader-model.json</code>​ ファイルで説明されます。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>bundleDescriptorLoader</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Object (オブジェクト)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">アプリケーションのバンドル座標の記述子。​<code>id</code>​ 項目は、アプリケーションのバンドル座標を理解するためにランタイムが使用するメカニズムを特定します。デフォルトは ​<code>mule</code>​ で、POM ファイルからアーティファクトグループ ID、アーティファクト ID、バージョンを読み込みます。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>secureProperties</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Array of String (文字列の配列)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">プラットフォームで安全に管理する必要があるアーティファクトの一連の設定プロパティを宣言します。</p></td>
</tr>
</tbody>
</table>

## [](#アプリケーションのバージョン管理)アプリケーションのバージョン管理

Mule Runtime はすべてのアーティファクトで [セマンティックバージョン管理](https://semver.org/)​に従います。セマンティックバージョン管理に従うと、リリースされるアセットの新バージョンがどのようなものかを API のクライアントが容易に想像できます。たとえば、Mule Connector の場合について考えてみます。パッチバージョンが更新されれば、バグ修正 (つまりバグの修正のみ) であることが予想できます。マイナーバージョンが更新された場合は新機能を期待できます。このどちらの変更も後方互換性があると予想されるため、問題なくアップグレードできます。他方、コネクタのメジャーバージョンが更新される場合は、新しい機能を追加したり、はるかに優れた UX を提供したりするために必然的に後方互換性が失われることになります。

また、Mule アーティファクト (アプリケーション、ドメイン、ポリシー) はセマンティックバージョン管理に従うため、Mule アプリケーションを操作するときに何らかの検証が必要になることがあります。Anypoint Platform がセマンティックバージョン管理に従うことで、新しいアセットが整理され、エクスペリエンスが向上します。たとえば、Mule ドメインに新しいメジャーバージョンがある場合、そのバージョンで定義されている一連のグローバルコンポーネントが前回のメジャーバージョンとは異なることを期待できます。そして、新しいドメインを使用するならば、元のドメインに属する Mule アプリケーションの更新が必要になることが予想されます。

## [](#mule-maven-プラグイン)Mule Maven プラグイン

Mule 4 の Mule Maven プラグインはアプリケーションを規定の形式でパッケージ化し、対象の環境にデプロイできるようにします。このプラグインは Studio 7 によって自動的に ​`pom.xml`​ に追加されます。このプラグインを使用してアプリケーションをデプロイする方法については、Mule Maven プラグインのドキュメントを参照してください。

<table><tbody><tr><td class="icon"><i class="fa icon-important" title="Important"></i></td><td class="content">ドメイン、ポリシー、Mule アーティファクトプラグイン (コネクタ、モジュールなど) はすべて Mule アプリケーションと同じ構造です。アーティファクトの種類ごとに、アーティファクト記述子 (​<code>mule-artifact.json</code>​) のプロパティ数が異なりますが、どれもよく似ており、すべてセマンティックバージョン管理に従う必要があります。</td></tr></tbody></table>

## [](#関連情報)関連情報

- [Mule Maven プラグインを使用した Mule アプリケーションのパッケージ化](https://docs.mulesoft.com/jp/mule-runtime/4.9/mmp-concept#mule-application-packaging)
- [Mule Maven プラグインを使用した Mule アプリケーションのデプロイ](https://docs.mulesoft.com/jp/mule-runtime/4.9/mmp-concept#mule-application-deployment)