Spring Mavenリポジトリ
1概要
この記事では、プロジェクトでSpring成果物を使用するときにMavenリポジトリを使用する方法について説明します。[Spring wiki]があります。以前のSpringSourceアーティファクト管理インフラストラクチャは
maven.springframework.org
でした – これはより強力な
repo.spring.io
を支持して現在では推奨されていません。
2 Mavenのリリース
すべてのGA/リリース成果物はMaven Centralに公開されているため、リリースのみが必要な場合は
pom
に新しいリポジトリを追加する必要はありません。ただし、何らかの理由でCentralが使用できない場合は、カスタムのhttp://repo.spring.io/release/
Spring Releases
用のMavenリポジトリもあります。
<repositories>
<repository>
<id>repository.spring.release</id>
<name>Spring GA Repository</name>
<url>http://repo.spring.io/release</url>
</repository>
</repositories>
Springアーティファクトのバージョン管理規則については、https://github.com/SpringSource/spring-framework/wiki/Downloading-Spring-artifacts#wiki-artifact__versioning[プロジェクトのwiki]を参照してください。
マイルストーンとスナップショットはMaven Centralに直接公開されていないため、これらにはそれぞれ固有のリポジトリがあります。
3 Mavenのマイルストーンとリリース候補
マイルストーンおよびRCの場合、以下のレポを
pom
に追加する必要があります。
<repositories>
<repository>
<id>repository.spring.milestone</id>
<name>Spring Milestone Repository</name>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
このリポジトリが定義された1つで、プロジェクトはSpring
マイルストーンの依存関係
を使用して開始することができます。
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.2.0.RC3</version>
</dependency>
4 Mavenのスナップショット
マイルストーンと同様に、Spring Snapshotはカスタムリポジトリでホストされています。
<repositories>
<repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/snapshot</url>
</repository>
</repositories>
リポジトリがpomで有効になると、プロジェクトはSpringスナップショットの使用を開始できます。
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.2.5.BUILD-SNAPSHOT</version>
</dependency>
そしてさらに:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.0.BUILD-SNAPSHOT</version>
</dependency>
スナップショットリポジトリはhttp://repo.spring.io/snapshot/[ブラウズ]にすることもできます。
5 Spring OSGI
用Mavenリポジトリ
OSGI互換のSpring成果物は、SpringSource
Enterprise Bundle Repository
(つまり、EBR)で管理されています。これらのリポジトリには、Spring Framework全体に有効なOSGIバンドルとライブラリ、およびこれらのライブラリに対する完全な依存関係のセットが含まれています。バンドルの場合:
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
そしてOSGI互換ライブラリの場合:
<repository>
<id>com.springsource.repository.libraries.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/release</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.external</id>
<name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/external</url>
</repository>
注:
SpringSource EBRは現在読み取り専用
であり、それ以降のSpring Framework 3.2.xリリースは公開されません。
6. 結論
この記事では、リリース候補、マイルストーン、スナップショットを使用するために、
pom
にSpring固有のMavenリポジトリを設定することに関する実用的な情報について説明します。