一位朋友已经通过了我正在尝试在我的计算机上本地运行的Maven项目。我在Eclipse中所做的一切,我选择了:
档案 - >导入 - >现有的Maven项目
之后,该项目在pom.xml
(失踪工件......)中向我显示了4个错误:
我尝试删除.m2
文件夹的内容,然后在Eclipse中点击了我的项目并选择了“Run as” - > “Maven clean”然后“Run as” - > “Maven安装”。但我仍然有同样的错误。我是Spring的新手,所以我不知道还能做什么。
编辑:
当我尝试这样做时:运行/ maven install,这就是我的控制台所说的:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DataLayer 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for javax.persistence:javax.persistence:jar:1.0.0 is missing, no dependency information available
[WARNING] The POM for hibernate-core:hibernate-core:jar:4.2.1.Final is missing, no dependency information available
[WARNING] The POM for hibernate-commons-annotations:hibernate-commons-annotations:jar:4.0.1.Final is missing, no dependency information available
[WARNING] The POM for jboss-logging:jboss-logging:jar:3.1.0.CR2 is missing, no dependency information available
[WARNING] The POM for jta:jta:jar:1.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.065s
[INFO] Finished at: Wed Aug 07 11:41:45 VET 2013
[INFO] Final Memory: 4M/90M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project DataLayer: Could not resolve dependencies for project SocialManager:DataLayer:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: javax.persistence:javax.persistence:jar:1.0.0, hibernate-core:hibernate-core:jar:4.2.1.Final, hibernate-commons-annotations:hibernate-commons-annotations:jar:4.0.1.Final, jboss-logging:jboss-logging:jar:3.1.0.CR2, jta:jta:jar:1.1: Failure to find javax.persistence:javax.persistence:jar:1.0.0 in http://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of JBoss repository 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.
EDIT2:这是我完整的pom.xml:https://dl.dropboxusercontent.com/u/31349296/pom.xml当我尝试在此处粘贴代码时看起来非常糟糕。
答案 0 :(得分:21)
答案 1 :(得分:4)
我知道这是一个老问题。但我希望我的回答会对某人有所帮助。我有同样的问题,我认为问题是它无法在本地存储库中找到那些.jar文件。所以我所做的是将以下代码添加到我的pom.xml中并且它有效。
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
答案 2 :(得分:1)
这是一个很晚的答案,但这可能会有所帮助。我去this link并搜索了ojdbc8(我试图添加jdbc oracle驱动程序) 单击结果时,将显示如下注释:
答案 3 :(得分:0)
这意味着maven无法从存储库下载工件。 以下步骤将帮助您:
答案 4 :(得分:0)
在我失去互联网连接后,我以某种方式遇到了这个问题。我能够通过更新Eclipse中的Maven索引,然后选择我的项目并更新快照/版本来修复它。
答案 5 :(得分:0)
SIMPLE ..
首先检查项目的结束标记。它应该在所有依赖标记关闭后放置。这样我解决了我的错误。 --Sush 快乐的编码:)