Maven依赖性错误

时间:2012-10-06 20:02:13

标签: java eclipse maven-3

  

可能重复:
  Maven Cannot Resolve Local Dependency

我正在使用maven 3和eclispe juno。

创建maven项目后,我使用了eclipse插件 生成eclipse文件并将项目导入eclipse。

我已经为maven项目添加了一个jar。

将jar文件安装到项目本地存储库中。 这是项目基目录中名为repo的文件。

install:install-file命令用于将jar添加到repo文件中,  然后将jar依赖项添加到项目的Pom文件中。

在eclipse IDE中,我能够将jar文件导入为 任何其他图书馆进口。

但是当我运行mvn compile命令时, 我得到一个依赖性错误,maven说 找不到jar文件。我提供以下代码。

他是POM回购配置

    <repository>
    <id>repo</id>
    <releases>
        <enabled>true</enabled>
        <checksumPolicy>ignore</checksumPolicy>
    </releases>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
    <url>file://${project.basedir}/repo</url>
</repository>

这是依赖配置

<dependency>
      <groupId>Com.RubineEngine.GesturePoints</groupId>
      <artifactId>Com-RubineEngine-GesturePoints</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency> 

使用U和X开关运行编译时,会出现以下错误

[DEBUG] ======================================================================= 
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for file://C:\U 
sers\FAISAL\Desktop\disaster\com-initialtheta-theta/repo 
Downloading: file://C:\Users\FAISAL\Desktop\disaster\com-initialtheta-theta/repo 
/Com/RubineEngine/GesturePoints/Com-RubineEngine-GesturePoints/1.0-SNAPSHOT/mave 
n-metadata.xml 
[DEBUG] Writing resolution tracking file C:\Users\FAISAL\.m2\repository\Com\Rubi 
neEngine\GesturePoints\Com-RubineEngine-GesturePoints\1.0-SNAPSHOT\resolver-stat 
us.properties 
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for repo 
.typesafe.com/typesafe/releases/ 
Downloading: repo.typesafe.com/typesafe/… 
Points/Com-RubineEngine-GesturePoints/1.0-SNAPSHOT/maven-metadata.xml 
[DEBUG] Writing resolution tracking file C:\Users\FAISAL\.m2\repository\Com\Rubi 
neEngine\GesturePoints\Com-RubineEngine-GesturePoints\1.0-SNAPSHOT\resolver-stat 
us.properties 
[DEBUG] Could not find metadata Com.RubineEngine.GesturePoints:Com-RubineEngine- 
GesturePoints:1.0-SNAPSHOT/maven-metadata.xml in typesafe (repo.typesafe. 
com/typesafe/releases/) 
[DEBUG] Could not find metadata Com.RubineEngine.GesturePoints:Com-RubineEngine- 
GesturePoints:1.0-SNAPSHOT/maven-metadata.xml in lib (file://C:\Users\FAISAL\Des 
ktop\disaster\com-initialtheta-theta/repo) 
[DEBUG] Skipped remote update check for Com.RubineEngine.GesturePoints:Com-Rubin 
eEngine-GesturePoints:1.0-SNAPSHOT/maven-metadata.xml, already updated during th 
is session. 
[DEBUG] Failure to find Com.RubineEngine.GesturePoints:Com-RubineEngine-GestureP 
oints:1.0-SNAPSHOT/maven-metadata.xml in repo.typesafe.com/typesafe/… 
ses/ was cached in the local repository, resolution will not be reattempted unti 
l the update interval of typesafe has elapsed or updates are forced 
[DEBUG] Skipped remote update check for Com.RubineEngine.GesturePoints:Com-Rubin 
eEngine-GesturePoints:1.0-SNAPSHOT/maven-metadata.xml, already updated during th 
is session. 
[DEBUG] Failure to find Com.RubineEngine.GesturePoints:Com-RubineEngine-GestureP 
oints:1.0-SNAPSHOT/maven-metadata.xml in file://C:\Users\FAISAL\Desktop\disaster 
\com-initialtheta-theta/repo was cached in the local repository, resolution will 
not be reattempted until the update interval of lib has elapsed or updates are 
forced

任何人都可以帮助我,因为我迟到了

1 个答案:

答案 0 :(得分:0)

尝试/确认的一些事情:

  • 机器是否可以访问互联网。不要只是这样说。通过ping远程的东西来确认它。 Maven不喜欢无法访问存储库
  • 在pom编辑器中,是否显示任何错误消息?您可以删除依赖项并使用添加依赖项对话框添加它吗?
  • 尝试将存储库放在Eclipse工作区之外。从理论上讲它应该可以工作,但是拥有一个存储库并且maven不喜欢“奇怪”是一个奇怪的地方。
  • 转到存储库根目录并确认文件夹名称与依赖关系的组ID,工件ID和版本完全匹配。