# 公開先のリポジトリを指定する

公開先のリモートリポジトリはpom.xmlの`distributionManagement`要素によって指定できます。 例として、[Sonatypeのoss-parents](https://github.com/sonatype/oss-parents/blob/master/oss-parent/pom.xml)から設定部分を引用してみましょう。

```markup
<!-- quoted from sonarype/oss-parents -->
<distributionManagement>
  <snapshotRepository>
    <id>sonatype-nexus-snapshots</id>
    <name>Sonatype Nexus Snapshots</name>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
  </snapshotRepository>
  <repository>
    <id>sonatype-nexus-staging</id>
    <name>Nexus Release Repository</name>
    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
  </repository>
</distributionManagement>
```

このように、スナップショットバージョンとリリースバージョンで利用するリポジトリは分かれています。 チームにのみスナップショットバージョンを公開したり、リリースバージョンとスナップショットバージョンで公開に必要な権限を変えたりといったことができます。

## セントラルリポジトリにライブラリを登録する

セントラルリポジトリには誰でもライブラリを公開できます。詳細は次のページを参照してください。

* [【最新版】Maven Central Repository へのライブラリ登録方法 #maven](http://samuraism.jp/diary/2012/05/03/1336047480000.html)

## リポジトリへのアクセス方法の指定

Mavenは基本的にWebDAVでのアクセスを行います。FTPやSSHを使用する場合は対応するプラグインの利用が必要です。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://maven3.kengo-toda.jp/deploy/specify-repository.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
