Gần đây tôi đã di chuyển từ Archiva sang Sonatype Nexus.Nexus: Không thể tìm thấy hiện vật
Tôi đang cố gắng sử dụng Lọ từ các kho lưu trữ của bên thứ 3 và Nexus không lưu trữ bộ nhớ cache vào kho lưu trữ cục bộ.
Tôi đã tìm kiếm câu trả lời trong phần này và không thể trả lời câu hỏi.
Đây là những gì tôi đã làm ...
Tôi đang sử dụng settings.xml:
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://THE_URL:8080/nexus/content/groups/public</url>
</mirror>
</mirrors>
<servers>
<server>
<id>admin</id>
<username>user</username>
<password>password</password>
</server>
</servers>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
Tôi cũng đã tạo kho proxy cho tất cả các kho bên thứ 3 Tôi đang sử dụng, và THÊM THEM CHO NHÓM CÔNG CỘNG NEXUS.
Tiếp theo, tôi đã chạy lệnh:
mvn clean install
và đã nhận lỗi sau:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building shlang 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://THE_URL:8080/nexus/content/groups/public/com/shadow/shadow/1/shadow-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.341s
[INFO] Finished at: Sun Jun 30 11:59:42 IDT 2013
[INFO] Final Memory: 6M/120M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project shlang: Could not resolve dependencies for project com.shadow:shlang:jar:1.0-SNAPSHOT: Failed to collect dependencies for [couchbase:couchbase-client:jar:1.1.5 (compile), com.google.code.gson:gson:pom:2.2.2 (compile), org.json:json:jar:20090211 (compile), net.sf.json-lib:json-lib:jar:jdk15:2.4 (compile), jline:jline:jar:2.10 (compile), commons-validator:commons-validator:jar:1.4.0 (compile), spy:spymemcached:jar:2.8.1 (compile), com.shadow:util:jar:1.0.1 (compile), com.shadow:monkey_schoolyard:jar:1.0.0 (compile)]: Failed to read artifact descriptor for com.shadow:util:jar:1.0.1: Could not find artifact com.shadow:shadow:pom:1 in nexus (http://THE_URL:8080/nexus/content/groups/public) -> [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
Kết quả trong repo địa phương là nó không chứa bất kỳ của bên thứ 3 lọ nên.
Tôi bỏ lỡ điều gì ở đây?
Bạn đã định cấu hình nhóm lưu trữ "công khai" làm bản sao của "*". Điều này có nghĩa là URL goto cho tất cả các tạo tác Maven của bạn. Tất cả các đồ tạo tác bạn đang cố truy xuất có được lấy từ URL nhóm đó không? Tôi đoán là không. –
Bạn dường như đang thiếu kho lưu trữ cho tạo tác 'couchbase-client' không nằm trong trung tâm Maven. Vì vậy, bạn phải thay đổi cấu hình cho kho lưu trữ công cộng của bạn có nghĩa là thêm kho lưu trữ có chứa các phụ thuộc ở trên. – khmarbaise
Có thể trùng lặp của [Maven Không thể giải quyết các phụ thuộc, hiện vật không thể được giải quyết] (http://stackoverflow.com/questions/4650460/maven-could-not-resolve-dependencies-artifacts-could-not-be-resolved) – naXa