Maven2のリポジトリ構築 〜Artifactoryのリポジトリ設定〜

間が空いてしまいましたが、Artifactoryを利用したインハウス・リポジトリの構築についてです。
目指すは、以下のような構成とすることです(Maven repositoryが、インハウス・リポジトリにあたる)。


Artifactoryで、インハウス・リポジトリや、リモート・リポジトリのキャッシュをしたりするのは、以下のファイルで設定します。

/etc/artifactory.config.xml



<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://artifactory.jfrog.org/xsd/1.0.0"
xsi:schemaLocation="http://artifactory.jfrog.org/xsd/1.0.0
http://www.jfrog.org/xsd/artifactory-v1_0_0.xsd">
<localRepositories>
<localRepository>
<key>libs-releases</key>
<description>Local Repository for Applications Releases</description>
<handleReleases>true</handleReleases>
<handleSnapshots>false</handleSnapshots>
</localRepository>
</localRepositories>

<remoteRepositories>
<remoteRepository>
<key>repo1</key>
<handleReleases>true</handleReleases>
<handleSnapshots>false</handleSnapshots>
<excludesPattern>org/artifactory/**,org/jfrog/**</excludesPattern>
<url>http://repo1.maven.org/maven2</url>
</remoteRepository>
<remoteRepository>
<key>seasar2</key>
<handleReleases>true</handleReleases>
<handleSnapshots>false</handleSnapshots>
<excludesPattern>org/artifactory/**,org/jfrog/**</excludesPattern>
<url>http://maven.seasar.org/maven2</url>
</remoteRepository>
</remoteRepositories>

</config>


「localRepositories」の設定がインハウス・リポジトリとして公開したいリポジトリ、「remoteRepositories」の設定がリモート・リポジトリの設定となります。


ここで設定しておけば、プロジェクトで作成したライブラリを公開したり、外部のリポジトリへのアクセスを制限したりすることが可能となります。