Maven,失去了当地的依赖|无法解决项目

时间:2015-08-03 15:18:52

标签: java eclipse maven

大家好,我有一个Maven项目,自9个月以来运作良好。

但今天我在Maven构建中遇到错误

[ERROR] Failed to execute goal on project bon: Could not resolve dependencies for project com.mydev:bon:war:1.0.20.1: Failure to find com.mydev:utils:jar:1.0.0-BUILD-SNAPSHOT in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of maven2 has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

该项目是一个带有maven的动态Web项目

pom中,我对本地jar有依赖

    <dependency>
        <groupId>com.mydev</groupId>
        <artifactId>utils</artifactId>
        <version>1.0.0-BUILD-SNAPSHOT</version>
    </dependency>

项目com.mydev.utils已安装在我的电脑的.m2文件夹中,我检查文件夹D:\.m2\repository\com\mydev\utils\1.0.0-BUILD-SNAPSHOT\,所有内容都按顺序显示

_rzi_0.118
_rzi_0.227
_maven.repositories
utils-1.0.0-BUILD-SNAPSHOT.jar
utils-1.0.0-BUILD-SNAPSHOT.jar.lastUpdate
utils-1.0.0-BUILD-SNAPSHOT.pom
utils-1.0.0-BUILD-SNAPSHOT.pom.lastUpdate
m2e.lastUpdate.properties
maven-metadata-local.xml
resolver-status.properties

我不认为问题是pom,我没有改变任何东西

我尝试使用相同的单元构建另一个项目,并得到相同的错误。

我昨天安装了软件(DB2 Express-C database server),而不是maven可能丢失了一些设置。安装软件时,请勿重启 今天尝试生成战争,但我得到错误,我重新启动PC,但我有同样的错误

编辑:

Eclipse congif, maven

1 个答案:

答案 0 :(得分:1)

还有一件事你不需要复制和粘贴东西,你可以轻松修改maven setting.xml以获取maven repo,并在eclipse中将其修改为正确的文件。在上面的scree shot用户设置路径应该是你的maven安装目录,如<your dir>\apache-maven-xxx\conf\settings.xml

<强>的settings.xml

<localRepository>D:\.m2</localRepository>