---
schema_version: "1"
id: 23619b2b835b5a4b33580c2754ee10c7b34a95190f3906753e8d576a90469722
title: XML を使用したコネクタの設定
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/connectors/introduction/intro-config-xml-maven.md
canonical_url: https://docs.mulesoft.com/jp/connectors/introduction/intro-config-xml-maven
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e537583d0eb18422b075c5b3ad2ad2be902fa31d2c59ce7a1d287db245a010ba
description: MuleSoft Documentation Site
latest: true
---
# XML を使用したコネクタの設定

XML で Mule アプリケーションを手動でコーディングすることもできますが、Anypoint Studio を使用した方が効率的です。

- Anypoint Studio の XML エディターまたはテキストエディターから Mule Runtime Engine (Mule) アプリケーションを手動でコーディングする場合、参照ステートメントを XML Mule フローと Apache Maven ​`pom.xml`​ ファイルの両方に追加することで、アプリケーションからコネクタにアクセスできます。
- Studio でコネクタを追加すると、Studio は自動的に XML コードにコネクタの名前空間およびスキーマの場所を入力し、​`pom.xml`​ ファイルに連動関係を追加します。

## [](#コネクタの名前空間の追加)コネクタの名前空間の追加

コネクタの名前空間を追加するには、設定 XML のヘッダーの ​`<mule>`​ タグ内に次のコードを貼り付けます。ここで、​`<connector>`​ はコネクタのユーザーガイドの「XML と Maven のサポート」トピックで指定されているコネクタ名です。

```xml
http://www.mulesoft.org/schema/mule/<connector>
http://www.mulesoft.org/schema/mule/<connector>/current/mule-<connector>.xsd
```

次の例は、​`<mule>`​ XML ブロック内に名前空間ステートメントが配置される方法を示しています。

```xml
<mule xmlns:<connector>="http://www.mulesoft.org/schema/mule/<connector>"
	xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns:file="http://www.mulesoft.org/schema/mule/file"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
	http://www.mulesoft.org/schema/mule/core/current/mule.xsd
	http://www.mulesoft.org/schema/mule/file
	http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
	http://www.mulesoft.org/schema/mule/http
	http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
	http://www.mulesoft.org/schema/mule/ee/core
	http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
	http://www.mulesoft.org/schema/mule/<connector>
	http://www.mulesoft.org/schema/mule/<connector>/current/mule-<connector>.xsd">
```

## [](#pom-ファイルの連動関係の追加)POM ファイルの連動関係の追加

Apache Maven ​`pom.xml`​ ファイルは Anypoint Studio によって生成され、Mule アプリケーションの連動関係が含まれます。Mule アプリケーションを手動でコーディングする場合、次の XML スニペットを ​`pom.xml`​ ファイルに含めてこのコネクタにアクセスできるようにします:

```xml
<dependency>
  <groupId>GROUP_ID_FROM_EXCHANGE</groupId>
  <artifactId>ARTIFACT_ID_FROM_EXCHANGE</artifactId>
  <version>x.x.x</version>
  <classifier>mule-plugin</classifier>
</dependency>
```

`GROUP_ID_FROM_EXCHANGE`​ と ​`ARTIFACT_ID_FROM_EXCHANGE`​ を Exchange から取得した正しい情報に置き換えます。

`x.x.x`​ を使用しているコネクタに対応するバージョンに置き換えます。

最新の ​`pom.xml`​ ファイル情報を取得する手順は、次のとおりです。

1. [Anypoint Exchange](https://www.mulesoft.com/exchange/)​ に移動します。
2. Exchange で、​**\[Login (ログイン)\]**​ をクリックし、Anypoint Platform のユーザー名とパスワードを指定します。
3. Exchange で、「​`<connector-name>`​」を検索します。
4. コネクタを選択します。
5. 画面の右上付近にある ​**\[Dependency Snippets (連動関係スニペット)\]**​ をクリックします。

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

- [Anypoint Connector の概要](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [MuleSoft ヘルプセンター](https://help.mulesoft.com)