Một người bạn đã chuyển cho tôi một dự án Maven mà tôi đang cố gắng chạy cục bộ trong máy tính của mình. Tất cả những gì tôi đã làm trong Eclipse, tôi chọn:Lỗi trong pom.xml với phụ thuộc (Thiếu tạo tác ...)
File -> Import -> Hiện có Maven Dự án
Sau đó, dự án chỉ cho tôi 4 sai sót trong pom.xml
của tôi (Thiếu vật ..) :
tôi đã cố gắng loại bỏ các nội dung của .m2
thư mục và sau đó trong Eclipse tôi nhấp vào dự án của tôi và chọn "Run as" -> "Maven sạch" và sau đó "Run as" -> "Maven Instal l ". Nhưng tôi vẫn có lỗi tương tự. Tôi mới với Spring nên tôi không biết phải làm gì khác.
EDIT:
Khi tôi cố gắng làm: chạy như/maven cài đặt, đây là những gì giao diện điều khiển của tôi nói rằng:
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: Đây là pom.xml hoàn chỉnh của tôi: https://dl.dropboxusercontent.com/u/31349296/pom.xml Nó trông khá khủng khiếp khi tôi cố gắng dán mã ở đây.
Tôi có phải thêm những dòng này vào cuối tệp pom.xml của mình không? hoặc nó phải ở trong tập tin khác ?. Sau đó tôi phải làm gì? thanks :) – kiduxa
Điều này cần được nhập trong cài đặt.xml – Lokesh
Nó cần phải nằm trong thẻ '' nhưng bạn chỉ có thể thêm nó trước ''. –
Bart