2016-06-23 5 views
1

maven을 사용하여 소스에서 라이브러리를 빌드 한 후 타사 세트를 nexus에 배포하려고합니다.타사 라이브러리 세트를 Nexus에 배포하는 방법

나는 단순히 mvn deploy을 사용할 수있을 거라고 생각하지만, 나는 다음과 같은 메시지가 얻을 : www.dcm4che.org와 나의 넥서스의 repo에 배포하려고처럼

[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ dcm4che-parent --- 
Uploading: scp://www.dcm4che.org:443/home/maven2/org/dcm4che/dcm4che-parent/3.3.7/dcm4che-parent-3.3.7.pom 
The authenticity of host 'www.dcm4che.org' can't be established. 
RSA key fingerprint is 41:7f:10:be:8d:15:30:f1:91:59:95:c7:5d:63:f7:31. 
Are you sure you want to continue connecting? (yes/no): yes 
Password: : 

이 나에게 보이는을 .

이런 식으로 mvn deploy을 사용할 수 있습니까?

문제없이이 방법으로 직접 넥서스에 libs를 배포 할 수 있습니다.

내가 뭘 잘못하고 있니?

UPDATE

this answer의 조언에 따라 나는 다음과 같은 명령을 실행 한 후 :

mvn deploy -DaltDeploymentRepository=nexus::default::http://192.168.50.200:8081/nexus/content/repositories/thirdparty 

을 나는 다음과 같은 오류 얻을 :

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project dcm4che-parent: Failed to deploy artifacts: Could not transfer artifact org.dcm4che:dcm4che-parent:pom:3.3.7 from/to nexus (http://192.168.50.200:8081/nexus/content/repositories/thirdparty): Failed to transfer file: http://192.168.50.200:8081/nexus/content/repositories/thirdparty/org/dcm4che/dcm4che-parent/3.3.7/dcm4che-parent-3.3.7.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1] 

은 내가 항목을 추가 한을 내 settings.xml은 다음과 같습니다 :

<servers> 
    <server> 
     <id>thirdparty</id> 
     <username>deployment</username> 
     <password>password</password> 
     <configuration></configuration> 
    </server> 
</servers> 

나는 그것이 동작하지 않습니다 여전히 다음 명령 줄 변화를 시도했지만 한

2 UPDATE. Maven 문서는 도움이되지 않습니다.

mvn deploy -DaltDeploymentRepository=thirdparty::default::http://192.168.50.200:8081 

는 오류가 생성

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project dcm4che-parent: Failed to deploy artifacts: Could not find artifact org.dcm4che:dcm4che-parent:pom:3.3.7 in thirdparty (http://192.168.50.200:8081) -> [Help 1] 

mvn deploy -DaltDeploymentRepository=thirdparty::default::http://192.168.50.200:8081/nexus/ 

는 오류가 생성

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project dcm4che-parent: Failed to deploy artifacts: Could not transfer artifact org.dcm4che:dcm4che-parent:pom:3.3.7 from/to thirdparty (http://192.168.50.200:8081/nexus/): Failed to transfer file: http://192.168.50.200:8081/nexus/org/dcm4che/dcm4che-parent/3.3.7/dcm4che-parent-3.3.7.pom. Return code is: 405, ReasonPhrase: HTTP method PUT is not supported by this URL. -> [Help 1] 

,691,363 (210)
mvn deploy -DaltDeploymentRepository=nexus::default::http://192.168.50.200:8081/nexus/content/repositories/ 

오류 발생 :

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project dcm4che-parent: Failed to deploy artifacts: Could not find artifact org.dcm4che:dcm4che-parent:pom:3.3.7 in nexus (http://192.168.50.200:8081/nexus/content/repositories/) -> [Help 1] 

최종 UPDATE이 우연히 발견 수있는 다른 사람들을위한

을, 다음 명령을했다. A_Di-Matteo에게 감사드립니다.

mvn deploy -DaltDeploymentRepository=thirdparty::default::http://192.168.50.200:8081/nexus/content/repositories/thirdparty 
+0

우선 프로토콜로 'scp'를 사용하는 것이 좋은 생각이거나 Nexus에서 일반적으로 사용하는 것에 의문을 가지고 있습니다. (http/https)가 사용됩니다. 또한 pom.xml의 어딘가에서 distributionManagement를 변경해야합니다 .... – khmarbaise

+0

'scp '가 어디서 어떻게 전개되는지 알지 못합니다. 의도적으로 내가 지정한 것은 아닙니다. – ksl

+0

@ksl 설정 스 니핏의 id가'thirdparty'인데, 명령 줄에서 '넥서스'를 전달하는 동안 두 번째 업데이트에서 일치하지 않습니다. –

답변

1

당신은 아마 dcm4che-parent-3.3.7.pom 유물로 다스 려하는, 어떤에서 : ​​당신이 볼 수 있듯이, 그 distributionManagement는 기본값으로 사용되는 빌드 오류에 언급 된 호스트로 다스 려한다

<distributionManagement> 
    <repository> 
     <id>www.dcm4che.org</id> 
     <name>dcm4che Repository</name> 
     <url>scp://www.dcm4che.org:443/home/maven2</url> 
    </repository> 
</distributionManagement> 

하나. 당신이 당신의 내부 넥서스에 배포 할 경우

, 당신은 다음 altDeploymentRepository 옵션을 사용해야합니다 :

Specifies an alternative repository to which the project artifacts should be deployed (other than those specified in <distributionManagement>). Format: id::layout::url .

그것의 사용자 속성은 altDeploymentRepository입니다.

따라서, 당신은 다음과 같은 메이븐을 호출 할 수 있습니다 메이븐 settings.xml에 지정된 저장소와 일치해야합니다

mvn clean deploy -DaltDeploymentRepository=yourId::layout::URL 

합니다.


일반적으로,이 방법으로 공공 유물을 넥서스 업로드 안 : 넥서스는 당신을 위해 그 (것)들을 검색 할 수 있습니다 및 기타 원격 저장소에 대한 더 중앙 집중화 된 캐시/관리 지점으로 사용 될 수있다.

공개 아티팩트를 변경 한 다음 내부 Nexus에 퍼블리시 한 경우 classifier 패치/회사 이름/유용성 세부 정보와 관련된 내용을 추가하는 것이 좋습니다 (자신의 Maven coordinates을 변경하는 것이 좋습니다).

+0

그럼 dcm4che repo를 내 넥서스 설정에 추가해야합니까? 그리고 dcm4che에 의존하는 응용 프로그램을 빌드하면 maven이 필요로하는 것을 가져 와서 빌드합니다. – ksl

+0

@ksl 예, 권장 접근 방식으로, 외부 의존성을 모두 업로드 할 필요가 없습니다. Nexus에서 가져 와서 캐시에 저장합니다. –