2013-06-30 3 views
9

최근 Archiva에서 Sonatype Nexus로 이전했습니다.Nexus : 이슈를 찾을 수 없습니다.

타사 저장소의 Jars를 사용하려고하는데 Nexus가 로컬 저장소에 캐시하지 않습니다.

이 섹션의 답변을 검색 한 결과 질문에 대한 답변을 찾을 수 없습니다.

<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> 

나는 또한 내가 사용하는 모든 제 3 자 저장소에 대한 프록시 저장소를 만들었습니다, 그리고 다음은

내가 Settings.XML이 사용하고

... 내가 무슨 짓을 NEXUS PUBLIC GROUP에 추가되었습니다.

다음, 나는 명령을 실행했습니다

mvn clean install 

을 다음과 같은 오류 있어요 :

[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 

지역의 repo의 결과는 제 3 자 중 하나를 포함하지 않는다는 것입니다을 항아리가 있어야합니다.

무엇이 여기에 있습니까?

+0

"공개"리포지토리 그룹을 "*"의 미러로 구성했습니다. 이는 모든 Maven 아티팩트에 대한 goto URL임을 의미합니다. 검색하려는 모든 아티팩트를 해당 그룹 URL에서 가져올 수 있습니까? 나는 추측하고있다. –

+1

Maven Central에없는 이슈 'couchbase-client'에 대한 저장소가 누락 된 것으로 보입니다. 따라서 공개 저장소의 구성을 변경해야합니다. 즉 위의 종속성을 포함하는 저장소를 추가해야합니다. – khmarbaise

+0

[Maven은 (는) 종속성을 해결할 수 없습니다. 이슈를 해결할 수 없습니다] (http://stackoverflow.com/questions/4650460/maven-could-not-resolve-dependencies-artifacts-could-not-be-resolved) – naXa

답변

6

대부분 로컬 Maven 저장소는 구성 요소를 캐시 할 수 없다는 사실을 가지고 있습니다. Maven이 스냅 샷 버전의 업데이트와 이전에 발견되지 않은 버전의 존재를 -U 플래그로 확인하도록 강제 할 수 있습니다. 일이 완전히 로컬 저장소에 각각의 폴더 구조를 삭제하는 데 도움이 될 수 있습니다 정말 이상한 경우

그래서

mvn clean install -U 

가끔 실행합니다. 만프레드의 솔루션은 당신을 위해 작동하지 않는 경우 귀하의 예제에서 그래서

rm -rf ~/.m2/repository/com/shadow/ 
2

, 다음 문제는 넥서스 이슈를 해결하기 위해 노력과 함께합니다.

브라우저를 사용하는 경우 Nexus가 실제로 수행중인 작업을 확인하여 내가 남긴 이슈를 찾을 수 있습니다.

덧붙이기를 ?을 이슈 경로와 함께 Nexus 리포지토리의 URL에 기술하십시오.

예. 넥서스 저장소 공공 저장소의 URL : http://my.nexus.server.address:8081/nexus/content/groups/public/

이 이슈를 가져 오기 위의 유물의

<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-api</artifactId> 
    <version>1.7.5</version> 
</dependency> 

경로는 다음과 같습니다 조직/SLF4J/SLF4J-API/1.7.5이/SLF4J-API-1.7.5 .저장소가없는 이유를

그래서 전체 URL이

http://my.nexus.server.address:8081/nexus/content/groups/public/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar?describe

이 프로세스는 다음 저장소가 지정되는 순서로 공개 저장소 그룹에서 구성 저장소의 목록을 통해 진행을 확인하기 위해 항아리 나타내는 요청 된 아티팩트를 제공합니다.

대부분의 이유는 아주 자명하며 무시할 수 있습니다.

오류가 여전히 저장소에 대해 찾을 수없는 것으로 캐싱되는 경우가 있습니다.이 저장소로 검색됩니다.

이것은 어떤 시점에서 Nexus가 이슈 검색을 시도했으나 찾지 못했음을 나타냅니다.

이 상태는 Nexus에서 캐시 된 것으로 보입니다. 캐시를 정리하는 가장 빠른 방법은 Nexus를 다시 시작하는 것입니다.

관련 문제