首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

maven下载依赖的有关问题

2012-07-27 
maven下载依赖的问题由于maven的 remote repositories地址只允许设置公司的仓库,项目中用到了一个外部依赖

maven下载依赖的问题

由于maven的 remote repositories地址只允许设置公司的仓库,项目中用到了一个外部依赖,代码提交后,测试环境编译提示

[INFO] Error building POM (may not be this project's POM).Project ID: org.codehaus.mojo:build-helper-maven-pluginReason: POM 'org.codehaus.mojo:build-helper-maven-plugin' not found in repository: Unable to download the artifact from any repository  org.codehaus.mojo:build-helper-maven-plugin:pom:1.4from the specified remote repositories:  b2b-central-cache (http://******/mvn/external),  b2b-shared-repo (http://******:9091/shared),  b2b-plugin-releases (http://******/mvn/internal/releases),  b2b-external-cache (http://******/mvn/external),  b2b-external-managed-repo (http://******:9091/external),  maven.pwatir.com (http://maven.pwatir.com/artifactory/repo/),  b2b-public-snapshots (http://******/mvn/public/snapshots),  b2b-public-releases (http://******/mvn/public/releases),  b2b-internal-snapshots (http://******/mvn/internal/snapshots),  central (http://******/mvn/internal/releases),  b2b-plugin-snapshots (http://******/mvn/internal/snapshots),  b2b-shared-repository (http://******:9091/shared),  com.alibaba.qa.shared (http://******/mvn/private/qa/releases/) for project org.codehaus.mojo:build-helper-maven-plugin

即build-helper-maven-plugin无法从目前设置的仓库地址下载,一般情况下只需要更改maven的setting.xml增加http://repo1.maven.org/maven2这个仓库即可。但由于机器权限问题,非root不能修改配置文件。

?

这个时候就把代码中的该依赖删除了,因为该依赖没用被用到,更新代码重新编译,始终如上提示。

?

个人觉得类似线程等待,如果maven下载pom这个操作不结束,始终无法进行其他maven操作

?

最终解决方法还是用root权限修改setting.xml增加下载地址使得该包可以下载,最后再将这个无用包删除不影响编译。

热点排行