Cha*_*had 10 dependencies maven-2 artifacts repository
在我的项目中,有许多依赖项可传递地包含在其他依赖项中,这些依赖项没有任何公司存储库中提供的pom.xml文件.这些是由各个团队支持的内部jar专用库,为了方便起见,这些库已经上传到存储库中,但不幸的是,这些存储库不是我可以使用的.
对于这些依赖项,Maven坚持每次运行构建时都尝试从每个存储库列表中检索poms,或者mvn dependency:list.这意味着maven尝试从7个不同的存储库位置检索8x pom文件,并且这是通过全球企业WAN进行的; 它真的很慢.
例如,对于一个特定的依赖
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] ------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
另一方面,对于只是无效的POM(例如较旧的modelVersion,或者是腐败/无效的XML),它只检查我的本地仓库,抱怨它无效然后继续.哪个好; 至少那不会在WAN上再试一次.
有没有办法(设置,覆盖,存储库配置更改)我可以阻止Maven的依赖插件/工件解析器反复尝试找到丢失的POM,如果它已经在本地存储库中有jar文件?
规范:Maven 2.2.1(默认的superPOM插件定义)JDK 1.6.0_18
Pascal的答案对于两个本地构建变通方法是正确的.但是,您最好的选择是请求这些项目的所有者为工件创建POM.它们不需要复杂,Maven在内部使用的简单替代方案将起作用:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>aGroupId</groupId>
<artifactId>aArtifactId</artifactId>
<version>4.0.14i</version>
</project>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9058 次 |
| 最近记录: |