【发布时间】:2012-10-07 04:14:23
【问题描述】:
我正在使用带有 eclispe juno 的 maven 3。
创建maven项目后,我使用了eclipse插件 生成eclipse文件并将项目导入eclipse。
我已将我创建的 jar 添加到 maven 项目中。
jar 文件安装到项目本地存储库中。 那是项目基目录中一个名为 repo 的文件。
install:install-file 命令用于将 jar 添加到 repo 文件中, 然后将 jar 依赖项添加到项目的 Pom 文件中。
在 Eclipse IDE 中,我可以将 jar 文件导入为 任何其他库导入。
但是,当我运行 mvn compile 命令时, 我得到一个依赖错误,maven 说 找不到 jar 文件。我提供以下代码。
这是 POM repo 配置
<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
谁可以帮帮我,因为我要迟到了
【问题讨论】:
-
我有一个愚蠢的问题我必须问:你之前在工作空间中成功构建过任何 maven 工件吗?
-
您在依赖项声明中使用快照版本似乎很奇怪,但是您尝试从中获取它的存储库已禁用快照。我找不到关于如何设置的具体说明,但我敢打赌这是不正确的。一种可能有帮助的资源是maven.apache.org/ref/3.0.4/maven-model/maven.html。