2016-11-16 2 views
0

나는 넥서스 서버를 설치했고 이후에이 넥서스 서버에 인공물을 간단하게 배포 할 의견이있었습니다.nexus 서버에 Artefact 배포 - 오류 종속성을 해결할 수 없음

mvn deploy

과 : 나는 내 유물을 배포하는 것을 시도했다

다음
<?xml version="1.0" encoding="UTF-8"?> 
<settings ...> 
    <pluginGroups> 
    </pluginGroups> 

    <proxies> 
    </proxies> 

    <servers> 
    </servers> 

    <mirrors> 
    <mirror>  
     <id>nexus</id> 
     <name>Nexus Public Mirror</name> 
     <mirrorOf>central</mirrorOf> 
     <url>http://it-nexus.domain:8081/nexus/content/groups/public</url> 
    </mirror> 
    </mirrors> 

    <profiles> 
    <profile> 
    <id>nexus</id> 
    <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> 
    <activeProfile>nexus</activeProfile> 
    </activeProfiles> 

</settings> 

:

<project xmlns="..."> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>MyProject</groupId> 
    <artifactId>MyProject</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <build> 
    <sourceDirectory>src</sourceDirectory> 
    <plugins> 
     <plugin> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>3.3</version> 
     <configuration> 
      <source>1.8</source> 
      <target>1.8</target> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

내 설정 파일은 다음과 같다 : 따라서 나는이 pom와 간단한 자바 프로젝트를 생성 이 오류가 발생했습니다 :

[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-resources-plugin 
:jar:2.6 in http://it-nexus.domain:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of 
nexus has elapsed or updates are forced -> [Help 1] 

사실 내가 뭘 잘못하고 있는지 몰라!?

답변

0

몇 가지 문제가 있습니다 (실제로 모든 것이 사실입니다).

먼저 profiles 및 그 아래 모든 내용을 activeProfiles과 함께 server.xml 파일에서 제거 할 수 있습니다. 다음으로 id 인 'nexus'서버를 포함하는 servers 항목을 추가해야합니다 (중앙 미러링에 사용하는 동일한 nexus 인스턴스에 업로드한다고 가정). 사용자 이름과 비밀번호를 입력해야합니다.

그런 다음 distributionManagement 섹션을 POM에두고 settings.xml 파일에서 지정한 server을 참조하고 maven-deployer 플러그인을 구성해야합니다. 그 문서는 here입니다. scm 섹션도 필요합니다.

실제 오류는 Nexus 서버가 실제로 프록시/미러 central으로 구성되지 않았기 때문에 발생합니다. 아, 그리고 mirrorOf에 대한 인수로 *을 사용해야합니다.