私のプロジェクトには、どの企業リポジトリでもpom.xmlファイルを使用できない他の依存関係から推移的に含まれる依存関係がいくつかあります。これらは、Maven以外のチームからの便宜のためにリポジトリにアップロードされた、さまざまなチームによってサポートされている内部jar専用ライブラリですが、残念ながら、これらのリポジトリは私のものではありません。
これらの依存関係について、Mavenは、ビルドを実行するたびに、各リポジトリリストからpomを取得しようとすることを主張しますmvn dependency:list。これは、mavenが7つの異なるリポジトリの場所から8x pomファイルを取得しようとすることを意味し、これがグローバルな企業WANを介していることを前提としています。本当に遅いです。
たとえば、1つの特定の依存関係
C:\Working\dev\workspace\project>mvn dependency:list
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building project
[INFO] task-segment: [dependency:list]
[INFO] ------------------------------------------------------------------------
[WARNING] Unable to get resource 'aGroupId:anArtifactId:pom:4.0.14i' from repository inhouse (http://someRepo1/proximity/repository/inhouse): While configuring wagon for 'inhouse': Unable to apply wagon configuration.
Downloading: http://someRepo1/proximity/repository/extFree/aGroupId/anArtifactId/4.0.14i/anArtifactId-4.0.14i.pom
[INFO] Unable to find resource 'aGroupId:anArtifactId:pom:4.0.14i' in repository extFree (http://someRepo1/proximity/repository/extFree)
Downloading: http://someRepo1/proximity/repository/externalNonFree/aGroupId/anArtifactId/4.0.14i/anArtifactId-4.0.14i.pom
[INFO] Unable to find resource 'aGroupId:anArtifactId:pom:4.0.14i' in repository extNonFree (http://someRepo1/proximity/repository/externalNonFree)
Downloading: http://someRepo2/efs/dist/maven/maven2-repository/incr/common/lib/aGroupId/anArtifactId/4.0.14i/anArtifactId-4.0.14i.pom
[INFO] Unable to find resource 'aGroupId:anArtifactId:pom:4.0.14i' in repository efsRepo (http://someRepo2/efs/dist/maven/maven2-repository/incr/common/lib)
Downloading: http://someRepo2/efs/dist/btijava/maven2-repository/incr/common/lib/aGroupId/anArtifactId/4.0.14i/anArtifactId-4.0.14i.pom
[INFO] Unable to find resource 'aGroupId:anArtifactId:pom:4.0.14i' in repository efsBTI (http://someRepo2/efs/dist/btijava/maven2-repository/incr/common/lib)
Downloading: http://someRepo3/maven/aGroupId/anArtifactId/4.0.14i/anArtifactId-4.0.14i.pom
[INFO] Unable to find resource 'aGroupId:anArtifactId:pom:4.0.14i' in repository internal.repo (http://someRepo3/maven)
Downloading: http://repo1.maven.org/maven2/aGroupId/anArtifactId/4.0.14i/anArtifactId-4.0.14i.pom
[INFO] Unable to find resource 'aGroupId:anArtifactId:pom:4.0.14i' in repository central (http://repo1.maven.org/maven2)`
...
etc
...
[INFO] [dependency:list {execution: default-cli}]
[INFO]
[INFO] The following files have been resolved:
... etc
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20 seconds
[INFO] Finished at: Tue Jan 26 15:01:48 CST 2010
[INFO] Final Memory: 31M/74M
[INFO] ------------------------------------------------------------------------
一方、無効なPOM(古いmodelVersion、または破損/無効なXMLなど)の場合は、ローカルリポジトリをチェックし、無効であると文句を言って続行します。これは問題ありません。少なくとも、WAN経由で再試行することはありません。
ローカルリポジトリにjarファイルがすでにある場合、Mavenの依存関係プラグイン/アーティファクトリゾルバーが欠落しているPOMを繰り返し見つけようとするのを防ぐ方法(設定、オーバーライド、リポジトリ構成の変更)はありますか?
仕様:Maven 2.2.1(デフォルトのsuperPOMプラグイン定義)JDK 1.6.0_18